Skip to main content

AsErrorSource

Trait AsErrorSource 

Source
pub trait AsErrorSource {
    // Required method
    fn as_error_source(&self) -> &(dyn Error + 'static);
}
Expand description

Converts the receiver into an Error trait object, suitable for use in Error::source.

It is expected that most users of SNAFU will not directly interact with this trait.

Required Methods§

Source

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method receivers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AsErrorSource for dyn Error + 'static

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

Source§

impl AsErrorSource for dyn Error + Send + 'static

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

Source§

impl AsErrorSource for dyn Error + Send + Sync + 'static

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

Source§

impl AsErrorSource for dyn Error + Sync + 'static

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

Implementors§

Source§

impl<T> AsErrorSource for T
where T: Error + 'static,