ErrorDown

Trait ErrorDown 

Source
pub trait ErrorDown {
    // Required methods
    fn is_chain<T: 'static + Display + Debug>(&self) -> bool;
    fn downcast_chain_ref<T: 'static + Display + Debug>(
        &self,
    ) -> Option<&Error<T>>;
    fn downcast_chain_mut<T: 'static + Display + Debug>(
        &mut self,
    ) -> Option<&mut Error<T>>;
    fn downcast_inner_ref<T: 'static + StdError>(&self) -> Option<&T>;
    fn downcast_inner_mut<T: 'static + StdError>(&mut self) -> Option<&mut T>;
}
Expand description

Convenience trait to hide the Error<T> implementation internals

Required Methods§

Source

fn is_chain<T: 'static + Display + Debug>(&self) -> bool

Test if of type Error<T>

Source

fn downcast_chain_ref<T: 'static + Display + Debug>(&self) -> Option<&Error<T>>

Downcast to a reference of Error<T>

Source

fn downcast_chain_mut<T: 'static + Display + Debug>( &mut self, ) -> Option<&mut Error<T>>

Downcast to a mutable reference of Error<T>

Source

fn downcast_inner_ref<T: 'static + StdError>(&self) -> Option<&T>

Downcast to T of Error<T>

Source

fn downcast_inner_mut<T: 'static + StdError>(&mut self) -> Option<&mut T>

Downcast to T mutable reference of Error<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ErrorDown for dyn StdError + 'static

Source§

fn is_chain<T: 'static + Display + Debug>(&self) -> bool

Source§

fn downcast_chain_ref<T: 'static + Display + Debug>(&self) -> Option<&Error<T>>

Source§

fn downcast_chain_mut<T: 'static + Display + Debug>( &mut self, ) -> Option<&mut Error<T>>

Source§

fn downcast_inner_ref<T: 'static + StdError>(&self) -> Option<&T>

Source§

fn downcast_inner_mut<T: 'static + StdError>(&mut self) -> Option<&mut T>

Source§

impl ErrorDown for dyn StdError + Send + 'static

Source§

fn is_chain<T: 'static + Display + Debug>(&self) -> bool

Source§

fn downcast_chain_ref<T: 'static + Display + Debug>(&self) -> Option<&Error<T>>

Source§

fn downcast_chain_mut<T: 'static + Display + Debug>( &mut self, ) -> Option<&mut Error<T>>

Source§

fn downcast_inner_ref<T: 'static + StdError>(&self) -> Option<&T>

Source§

fn downcast_inner_mut<T: 'static + StdError>(&mut self) -> Option<&mut T>

Source§

impl ErrorDown for dyn StdError + Send + Sync + 'static

Source§

fn is_chain<T: 'static + Display + Debug>(&self) -> bool

Source§

fn downcast_chain_ref<T: 'static + Display + Debug>(&self) -> Option<&Error<T>>

Source§

fn downcast_chain_mut<T: 'static + Display + Debug>( &mut self, ) -> Option<&mut Error<T>>

Source§

fn downcast_inner_ref<T: 'static + StdError>(&self) -> Option<&T>

Source§

fn downcast_inner_mut<T: 'static + StdError>(&mut self) -> Option<&mut T>

Implementors§

Source§

impl<U: 'static + Display + Debug> ErrorDown for Error<U>