pub struct Error<K = String> { /* private fields */ }Implementations§
source§impl<K> Error<K>
impl<K> Error<K>
pub fn new(kind: ErrorKind<K>, msg: impl ToString) -> Self
sourcepub fn set_message(&mut self, msg: impl ToString)
pub fn set_message(&mut self, msg: impl ToString)
Set the error message
sourcepub fn into_message(self) -> String
pub fn into_message(self) -> String
Consume the error and return the message
sourcepub fn with_kind(self, kind: ErrorKind<K>) -> Self
pub fn with_kind(self, kind: ErrorKind<K>) -> Self
A functional method for setting the error kind
sourcepub fn with_message(self, msg: impl ToString) -> Self
pub fn with_message(self, msg: impl ToString) -> Self
A functional method for setting the error message
Trait Implementations§
source§impl<'de, K> Deserialize<'de> for Error<K>where
K: Deserialize<'de>,
impl<'de, K> Deserialize<'de> for Error<K>where
K: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<K> Error for Error<K>
impl<K> Error for Error<K>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<K, T> From<TryLockError<T>> for Error<K>
impl<K, T> From<TryLockError<T>> for Error<K>
source§fn from(err: TryLockError<T>) -> Self
fn from(err: TryLockError<T>) -> Self
Converts to this type from the input type.
source§impl<K: Ord> Ord for Error<K>
impl<K: Ord> Ord for Error<K>
source§impl<K: PartialEq> PartialEq for Error<K>
impl<K: PartialEq> PartialEq for Error<K>
source§impl<K: PartialOrd> PartialOrd for Error<K>
impl<K: PartialOrd> PartialOrd for Error<K>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<K: Eq> Eq for Error<K>
impl<K> StructuralPartialEq for Error<K>
Auto Trait Implementations§
impl<K> Freeze for Error<K>where
K: Freeze,
impl<K> RefUnwindSafe for Error<K>where
K: RefUnwindSafe,
impl<K> Send for Error<K>where
K: Send,
impl<K> Sync for Error<K>where
K: Sync,
impl<K> Unpin for Error<K>where
K: Unpin,
impl<K> UnwindSafe for Error<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