AddStatusCode

Trait AddStatusCode 

Source
pub trait AddStatusCode<T, E>: Into<Result<T, E>>
where E: Into<Error>,
{ // Provided method fn status_code(self, status_code: StatusCode) -> Result<T> { ... } }
Expand description

Convenience trait to convert Result into serror::Result by adding status to the inner error, if it exists.

Provided Methods§

Source

fn status_code(self, status_code: StatusCode) -> Result<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.

Implementors§

Source§

impl<R, T, E> AddStatusCode<T, E> for R
where R: Into<Result<T, E>>, E: Into<Error>,