pub struct ErrorMessage(/* private fields */);Expand description
A lightweight owned error message.
Implementations§
Source§impl ErrorMessage
impl ErrorMessage
Sourcepub const fn empty() -> ErrorMessage
pub const fn empty() -> ErrorMessage
Creates an empty error message.
Sourcepub const fn from_bstr(msg: ByteString) -> ErrorMessage
pub const fn from_bstr(msg: ByteString) -> ErrorMessage
Creates an error message from a ByteString.
Sourcepub const fn from_static(msg: &'static str) -> ErrorMessage
pub const fn from_static(msg: &'static str) -> ErrorMessage
Creates an error message from a static string.
Sourcepub fn as_bstr(&self) -> &ByteString
pub fn as_bstr(&self) -> &ByteString
Returns the underlying ByteString.
Sourcepub fn into_string(self) -> ByteString
pub fn into_string(self) -> ByteString
Converts this message into its underlying ByteString.
Sourcepub fn with_source<E>(self, source: E) -> ErrorMessageChained
pub fn with_source<E>(self, source: E) -> ErrorMessageChained
Attaches a source error to this message.
Trait Implementations§
Source§impl Clone for ErrorMessage
impl Clone for ErrorMessage
Source§fn clone(&self) -> ErrorMessage
fn clone(&self) -> ErrorMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorMessage
impl Debug for ErrorMessage
Source§impl Display for ErrorMessage
impl Display for ErrorMessage
impl Eq for ErrorMessage
Source§impl Error for ErrorMessage
impl Error for ErrorMessage
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl<'a> From<&'a ErrorMessage> for ByteString
impl<'a> From<&'a ErrorMessage> for ByteString
Source§fn from(msg: &'a ErrorMessage) -> ByteString
fn from(msg: &'a ErrorMessage) -> ByteString
Converts to this type from the input type.
Source§impl From<&'static str> for ErrorMessage
impl From<&'static str> for ErrorMessage
Source§fn from(value: &'static str) -> ErrorMessage
fn from(value: &'static str) -> ErrorMessage
Converts to this type from the input type.
Source§impl From<ByteString> for ErrorMessage
impl From<ByteString> for ErrorMessage
Source§fn from(value: ByteString) -> ErrorMessage
fn from(value: ByteString) -> ErrorMessage
Converts to this type from the input type.
Source§impl From<ErrorMessage> for ByteString
impl From<ErrorMessage> for ByteString
Source§fn from(msg: ErrorMessage) -> ByteString
fn from(msg: ErrorMessage) -> ByteString
Converts to this type from the input type.
Source§impl From<String> for ErrorMessage
impl From<String> for ErrorMessage
Source§fn from(value: String) -> ErrorMessage
fn from(value: String) -> ErrorMessage
Converts to this type from the input type.
Source§impl PartialEq for ErrorMessage
impl PartialEq for ErrorMessage
impl StructuralPartialEq for ErrorMessage
Auto Trait Implementations§
impl Freeze for ErrorMessage
impl RefUnwindSafe for ErrorMessage
impl Send for ErrorMessage
impl Sync for ErrorMessage
impl Unpin for ErrorMessage
impl UnsafeUnpin for ErrorMessage
impl UnwindSafe for ErrorMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.