pub struct ErrorBase<E = Box<dyn Error + 'static>> { /* private fields */ }Implementations§
Source§impl<E> ErrorBase<E>where
E: Error,
impl<E> ErrorBase<E>where
E: Error,
pub const fn new(kind: ErrorKind, source: Option<E>) -> Self
pub const fn unknown(source: E) -> Self
Sourcepub fn with_kind(self, kind: ErrorKind) -> ErrorBase<E>
pub fn with_kind(self, kind: ErrorKind) -> ErrorBase<E>
consumes the current error to create another of the given kind
Sourcepub fn with_source<E2>(self, source: E2) -> ErrorBase<E2>where
E2: Error,
pub fn with_source<E2>(self, source: E2) -> ErrorBase<E2>where
E2: Error,
consumes the current error to create another with the given message
Trait Implementations§
Source§impl<E> Error for ErrorBase<E>where
E: 'static + Error,
impl<E> Error for ErrorBase<E>where
E: 'static + Error,
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()
Source§impl<E: Ord> Ord for ErrorBase<E>
impl<E: Ord> Ord for ErrorBase<E>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<E: PartialOrd> PartialOrd for ErrorBase<E>
impl<E: PartialOrd> PartialOrd for ErrorBase<E>
impl<E: Copy> Copy for ErrorBase<E>
impl<E: Eq> Eq for ErrorBase<E>
impl<E> StructuralPartialEq for ErrorBase<E>
Auto Trait Implementations§
impl<E> Freeze for ErrorBase<E>where
E: Freeze,
impl<E> RefUnwindSafe for ErrorBase<E>where
E: RefUnwindSafe,
impl<E> Send for ErrorBase<E>where
E: Send,
impl<E> Sync for ErrorBase<E>where
E: Sync,
impl<E> Unpin for ErrorBase<E>where
E: Unpin,
impl<E> UnwindSafe for ErrorBase<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