Trait Status

Source
pub trait Status<T> {
    // Required method
    fn with_status(self, status: impl FnOnce() -> StatusCode) -> Result<T>;

    // Provided method
    fn status(self, status: StatusCode) -> Result<T>
       where Self: Sized { ... }
}

Required Methods§

Source

fn with_status(self, status: impl FnOnce() -> StatusCode) -> Result<T>

Provided Methods§

Source

fn status(self, status: StatusCode) -> Result<T>
where Self: Sized,

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<T> Status<T> for Option<T>

Source§

fn with_status(self, status: impl FnOnce() -> StatusCode) -> Result<T>

Source§

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

Source§

fn with_status(self, status: impl FnOnce() -> StatusCode) -> Result<T>

Implementors§