Trait DerefException

Source
pub trait DerefException {
    // Required method
    fn deref_mut_exception(&mut self) -> Self;
}
Expand description

§deref the exception

convert &mut self to Self

  • impl each exception

§example

impl DerefException for SuperException {
    fn deref_mut_exception(&mut self) -> Self {
        SuperException {
            code: self.code(),
            msg: String::from(self.msg()),
            level: self.level(),
        }
    }
}

Required Methods§

Source

fn deref_mut_exception(&mut self) -> Self

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.

Implementors§