Skip to main content

ErrorExt

Trait ErrorExt 

Source
pub trait ErrorExt<T> {
    // Required method
    fn prepend_error<M: AsRef<[u8]> + Display>(self, msg: M) -> Result<T, Error>;
}
Expand description

Extensions on Result<T, std::io::Error> for error context.

Required Methods§

Source

fn prepend_error<M: AsRef<[u8]> + Display>(self, msg: M) -> Result<T, Error>

Prepends msg to the error message, keeping the original text.

§Errors

Returns the original error with msg prepended to its message.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> ErrorExt<T> for Result<T, Error>

Source§

fn prepend_error<M: AsRef<[u8]> + Display>(self, msg: M) -> Result<T, Error>

Implementors§