[][src]Trait core_error::Error

pub trait Error: Debug + Display + TypeInfo {
    fn source(&self) -> Option<&(dyn Error + 'static)> { ... }
}

Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>. Errors must describe themselves through the Display and Debug traits, and may provide cause chain information:

The source method is generally used when errors cross "abstraction boundaries". If one module must report an error that is caused by an error from a lower-level module, it can allow access to that error via the source method. This makes it possible for the high-level module to provide its own errors while also revealing some of the implementation for debugging via source chains.

Provided methods

fn source(&self) -> Option<&(dyn Error + 'static)>

Loading content...

Methods

impl dyn Error + 'static[src]

pub fn is<T: Error + Any>(&self) -> bool[src]

Returns true if the boxed type is the same as T

pub fn downcast_ref<T: Error + Any>(&self) -> Option<&T>[src]

Returns some reference to the boxed value if it is of type T, or None if it isn't.

pub fn downcast_mut<T: Error + Any>(&mut self) -> Option<&mut T>[src]

Returns some mutable reference to the boxed value if it is of type T, or None if it isn't.

impl dyn Error + Send + 'static[src]

pub fn is<T: Error + Any>(&self) -> bool[src]

Returns true if the boxed type is the same as T

pub fn downcast_ref<T: Error + Any>(&self) -> Option<&T>[src]

Returns some reference to the boxed value if it is of type T, or None if it isn't.

pub fn downcast_mut<T: Error + Any>(&mut self) -> Option<&mut T>[src]

Returns some mutable reference to the boxed value if it is of type T, or None if it isn't.

impl dyn Error + Send + Sync + 'static[src]

pub fn is<T: Error + Any>(&self) -> bool[src]

Returns true if the boxed type is the same as T

pub fn downcast_ref<T: Error + Any>(&self) -> Option<&T>[src]

Returns some reference to the boxed value if it is of type T, or None if it isn't.

pub fn downcast_mut<T: Error + Any>(&mut self) -> Option<&mut T>[src]

Returns some mutable reference to the boxed value if it is of type T, or None if it isn't.

Implementations on Foreign Types

impl Error for ParseBoolError[src]

impl Error for Utf8Error[src]

impl Error for ParseIntError[src]

impl Error for ParseFloatError[src]

impl Error for Error[src]

impl Error for BorrowMutError[src]

impl Error for BorrowError[src]

impl Error for ParseCharError[src]

impl Error for DecodeUtf16Error[src]

impl Error for LayoutErr[src]

impl Error for TryFromIntError[src]

impl Error for TryFromSliceError[src]

impl Error for CharTryFromError[src]

impl Error for Infallible[src]

Loading content...

Implementors

Loading content...