pub struct StdError<K: ErrorKind = String> { /* private fields */ }
Expand description
The StdError
type is a generic error type that is generic over the error kind; this
enables us to distinguish between distinctly different error types.
Implementations§
Source§impl<K> StdError<K>where
K: ErrorKind,
impl<K> StdError<K>where
K: ErrorKind,
Sourcepub fn set_kind(&mut self, value: K) -> &mut Self
pub fn set_kind(&mut self, value: K) -> &mut Self
update the kind before returning a mutable reference to the current instance.
Sourcepub fn set_message<V: ToString>(&mut self, value: V) -> &mut Self
pub fn set_message<V: ToString>(&mut self, value: V) -> &mut Self
update the message before returning a mutable reference to the current instance.
Sourcepub fn with_kind(self, kind: K) -> Self
pub fn with_kind(self, kind: K) -> Self
consumes the current instance to create another with the given kind
Sourcepub fn with_message(self, message: String) -> Self
pub fn with_message(self, message: String) -> Self
consumes the current instance to create another with the given message.
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for StdError<K>where
K: Freeze,
impl<K> RefUnwindSafe for StdError<K>where
K: RefUnwindSafe,
impl<K> Unpin for StdError<K>where
K: Unpin,
impl<K> UnwindSafe for StdError<K>where
K: UnwindSafe,
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