[][src]Trait sgx_tstd::error::Error

pub trait Error: Debug + Display {
    fn source(&self) -> Option<&(dyn Error + 'static)> { ... }
fn type_id(&self, _: Internal) -> TypeId
    where
        Self: 'static
, { ... }
fn description(&self) -> &str { ... }
fn cause(&self) -> Option<&dyn Error> { ... } }

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)>

The lower-level source of this error, if any.

fn type_id(&self, _: Internal) -> TypeId where
    Self: 'static, 

Gets the TypeId of self.

fn description(&self) -> &str

if let Err(e) = "xc".parse::<u32>() {
    // Print `e` itself, no need for description().
    eprintln!("Error: {}", e);
}

fn cause(&self) -> Option<&dyn Error>

Loading content...

Methods

impl dyn Error + 'static[src]

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

Returns true if the boxed type is the same as T

pub fn downcast_ref<T: Error + 'static>(&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 + 'static>(&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 + 'static>(&self) -> bool[src]

Forwards to the method defined on the type dyn Error.

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

Forwards to the method defined on the type dyn Error.

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

Forwards to the method defined on the type dyn Error.

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

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

Forwards to the method defined on the type dyn Error.

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

Forwards to the method defined on the type dyn Error.

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

Forwards to the method defined on the type dyn Error.

impl dyn Error[src]

pub fn downcast<T: Error + 'static>(
    self: Box<Self>
) -> Result<Box<T>, Box<dyn Error>>
[src]

Attempts to downcast the box to a concrete type.

pub fn chain(&self) -> Chain[src]

Returns an iterator starting with the current error and continuing with recursively calling [source].

If you want to omit the current error and only use its sources, use skip(1).

pub fn iter_chain(&self) -> ErrorIter[src]

Returns an iterator starting with the current error and continuing with recursively calling [source].

pub fn iter_sources(&self) -> ErrorIter[src]

Returns an iterator starting with the [source] of this error and continuing with recursively calling [source].

impl dyn Error + Send[src]

pub fn downcast<T: Error + 'static>(
    self: Box<Self>
) -> Result<Box<T>, Box<dyn Error + Send>>
[src]

Attempts to downcast the box to a concrete type.

impl dyn Error + Send + Sync[src]

pub fn downcast<T: Error + 'static>(
    self: Box<Self>
) -> Result<Box<T>, Box<Self>>
[src]

Attempts to downcast the box to a concrete type.

Implementations on Foreign Types

impl Error for sgx_status_t[src]

Loading content...

Implementors

impl Error for ![src]

impl Error for TryReserveError[src]

impl Error for VarError[src]

impl Error for AllocErr[src]

impl Error for LayoutErr[src]

impl Error for TryFromSliceError[src]

impl Error for BorrowError[src]

impl Error for BorrowMutError[src]

impl Error for CharTryFromError[src]

impl Error for DecodeUtf16Error[src]

impl Error for ParseCharError[src]

impl Error for JoinPathsError[src]

impl Error for FromBytesWithNulError[src]

impl Error for IntoStringError[src]

impl Error for NulError[src]

impl Error for sgx_tstd::fmt::Error[src]

impl Error for sgx_tstd::io::Error[src]

impl Error for AddrParseError[src]

impl Error for ParseFloatError[src]

impl Error for ParseIntError[src]

impl Error for TryFromIntError[src]

impl Error for StripPrefixError[src]

impl Error for ParseBoolError[src]

impl Error for Utf8Error[src]

impl Error for FromUtf16Error[src]

impl Error for FromUtf8Error[src]

impl Error for AccessError[src]

impl Error for SystemTimeError[src]

impl Error for ParseError[src]

impl<T> Error for TryLockError<T>[src]

impl<T> Error for PoisonError<T>[src]

impl<T: Error> Error for Box<T>[src]

impl<W: Send + Debug> Error for IntoInnerError<W>[src]

Loading content...