pub struct GenericError<T>where
T: 'static,{ /* private fields */ }
Expand description
Wrapper around any error T such that it is Clone
,
serde::Serialize
, and serde::Deserialize
by storing
its initial Debug
and Display
representations as String
s.
Implementations§
Source§impl<T> GenericError<T>
impl<T> GenericError<T>
Sourcepub fn untyped(self) -> GenericError<Untyped>
pub fn untyped(self) -> GenericError<Untyped>
Preserves source
Source§impl<E> GenericError<E>
impl<E> GenericError<E>
Sourcepub fn from(err: E) -> GenericError<E>
pub fn from(err: E) -> GenericError<E>
Preserves source
Sourcepub fn from_ref(err: &E) -> GenericError<E>
pub fn from_ref(err: &E) -> GenericError<E>
Preserves source
Source§impl<E> GenericError<E>
impl<E> GenericError<E>
pub fn from_non_err(err: E) -> GenericError<E>
pub fn from_non_err_ref(err: &E) -> GenericError<E>
Trait Implementations§
Source§impl<T> Clone for GenericError<T>
impl<T> Clone for GenericError<T>
Source§impl<T> Debug for GenericError<T>
impl<T> Debug for GenericError<T>
Source§impl<'de, T> Deserialize<'de> for GenericError<T>where
T: 'static,
impl<'de, T> Deserialize<'de> for GenericError<T>where
T: 'static,
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<T> Display for GenericError<T>
impl<T> Display for GenericError<T>
Source§impl<T> Error for GenericError<T>
impl<T> Error for GenericError<T>
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()
Auto Trait Implementations§
impl<T> Freeze for GenericError<T>
impl<T> RefUnwindSafe for GenericError<T>where
T: RefUnwindSafe,
impl<T> Send for GenericError<T>where
T: Send,
impl<T> Sync for GenericError<T>where
T: Sync,
impl<T> Unpin for GenericError<T>where
T: Unpin,
impl<T> UnwindSafe for GenericError<T>where
T: 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