pub struct ErrorMessageChained { /* private fields */ }Expand description
An owned error message with an optional source error.
Implementations§
Source§impl ErrorMessageChained
impl ErrorMessageChained
Sourcepub const fn from_bstr(msg: ByteString) -> Self
pub const fn from_bstr(msg: ByteString) -> Self
Creates a message error without a source from a ByteString.
Sourcepub const fn from_static(msg: &'static str) -> Self
pub const fn from_static(msg: &'static str) -> Self
Creates a message error without a source from a static string.
Sourcepub fn as_bstr(&self) -> &ByteString
pub fn as_bstr(&self) -> &ByteString
Returns the message as a ByteString.
Sourcepub fn into_string(self) -> ByteString
pub fn into_string(self) -> ByteString
Converts this error into its message, the source is dropped.
Sourcepub fn with_source<E: StdError + Send + Sync + 'static>(self, source: E) -> Self
pub fn with_source<E: StdError + Send + Sync + 'static>(self, source: E) -> Self
Sets the source error, replacing the current one.
Trait Implementations§
Source§impl Clone for ErrorMessageChained
impl Clone for ErrorMessageChained
Source§impl Debug for ErrorMessageChained
impl Debug for ErrorMessageChained
Source§impl Display for ErrorMessageChained
impl Display for ErrorMessageChained
Source§impl Error for ErrorMessageChained
impl Error for ErrorMessageChained
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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<M: Into<ErrorMessage>> From<M> for ErrorMessageChained
impl<M: Into<ErrorMessage>> From<M> for ErrorMessageChained
Auto Trait Implementations§
impl !RefUnwindSafe for ErrorMessageChained
impl !UnwindSafe for ErrorMessageChained
impl Freeze for ErrorMessageChained
impl Send for ErrorMessageChained
impl Sync for ErrorMessageChained
impl Unpin for ErrorMessageChained
impl UnsafeUnpin for ErrorMessageChained
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