[−][src]Trait http_types::Status
Provides the status
method for Result
and Option
.
This trait is sealed and cannot be implemented outside of http-types
.
Required methods
fn status<S>(self, status: S) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
S: TryInto<StatusCode>,
S::Error: Debug,
Wrap the error value with an additional status code.
fn with_status<S, F>(self, f: F) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,
Wrap the error value with an additional status code that is evaluated lazily only once an error does occur.
Implementations on Foreign Types
impl<T, E> Status<T, E> for Result<T, E> where
E: StdError + Send + Sync + 'static,
[src]
E: StdError + Send + Sync + 'static,
fn status<S>(self, status: S) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
[src]
S: TryInto<StatusCode>,
S::Error: Debug,
fn with_status<S, F>(self, f: F) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,
[src]
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,
impl<T> Status<T, Infallible> for Option<T>
[src]
fn status<S>(self, status: S) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
[src]
S: TryInto<StatusCode>,
S::Error: Debug,
fn with_status<S, F>(self, f: F) -> Result<T, Error> where
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,
[src]
S: TryInto<StatusCode>,
S::Error: Debug,
F: FnOnce() -> S,