pub struct Error<E> { /* private fields */ }Expand description
Represents an error. Stores an original error of type E, and any number of ErrorPoints at which the error was propagated.
Implementations§
Source§impl<E> Error<E>
impl<E> Error<E>
Sourcepub fn get_context(&self) -> &[KvPair]
pub fn get_context(&self) -> &[KvPair]
get context
Sourcepub fn points(&self) -> &[ErrorPoint]
pub fn points(&self) -> &[ErrorPoint]
Gets all ErrorPoints where this Error was thrown. These are in reverse order, with the first time it was thrown first and the latest time it was thrown last.
Sourcepub fn original_error(&self) -> &E
👎Deprecated: use error instead.
pub fn original_error(&self) -> &E
error instead.Gets the original error which this Error was constructed with.
Sourcepub fn into_origin(self) -> E
pub fn into_origin(self) -> E
Move the original error out.
Sourcepub fn into_error<N>(self) -> Nwhere
E: Into<N>,
pub fn into_error<N>(self) -> Nwhere
E: Into<N>,
Take out the original error and transform into another type where the original error can transform into that type.
Trait Implementations§
Source§impl<E> Error for Error<E>where
E: Error,
Available on crate feature std only.
impl<E> Error for Error<E>where
E: Error,
Available on crate feature
std only.Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnwindSafe for Error<E>where
E: 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