pub struct ErrorMessage(/* private fields */);Expand description
A lightweight owned error message.
Implementations§
Source§impl ErrorMessage
impl ErrorMessage
Sourcepub const fn from_bstr(msg: ByteString) -> Self
pub const fn from_bstr(msg: ByteString) -> Self
Creates an error message from a ByteString.
Sourcepub const fn from_static(msg: &'static str) -> Self
pub const fn from_static(msg: &'static str) -> Self
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: StdError + Send + Sync + 'static>(
self,
source: E,
) -> ErrorMessageChained
pub fn with_source<E: StdError + Send + Sync + 'static>( self, source: E, ) -> ErrorMessageChained
Attaches a source error to this message.
Trait Implementations§
Source§impl Clone for ErrorMessage
impl Clone for ErrorMessage
Source§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) -> Self
fn from(msg: &'a ErrorMessage) -> Self
Converts to this type from the input type.
Source§impl From<&'static str> for ErrorMessage
impl From<&'static str> for ErrorMessage
Source§impl From<ByteString> for ErrorMessage
impl From<ByteString> for ErrorMessage
Source§fn from(value: ByteString) -> Self
fn from(value: ByteString) -> Self
Converts to this type from the input type.
Source§impl From<ErrorMessage> for ByteString
impl From<ErrorMessage> for ByteString
Source§fn from(msg: ErrorMessage) -> Self
fn from(msg: ErrorMessage) -> Self
Converts to this type from the input type.
Source§impl From<String> for ErrorMessage
impl From<String> for ErrorMessage
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