[][src]Trait tide::ResultExt

pub trait ResultExt<T>: Sized {
    fn with_err_status<S>(self, status: S) -> Result<T>
    where
        StatusCode: HttpTryFrom<S>
; fn client_err(self) -> Result<T> { ... }
fn server_err(self) -> Result<T> { ... } }

Extension methods for Result.

Required methods

fn with_err_status<S>(self, status: S) -> Result<T> where
    StatusCode: HttpTryFrom<S>, 

Convert to an Result, wrapping the Err case with a custom response status.

Loading content...

Provided methods

fn client_err(self) -> Result<T>

Convert to an Result, treating the Err case as a client error (response code 400).

fn server_err(self) -> Result<T>

Convert to an Result, treating the Err case as a server error (response code 500).

Loading content...

Implementations on Foreign Types

impl<T, E: Error + Send + Sync + 'static> ResultExt<T> for Result<T, E>[src]

Loading content...

Implementors

Loading content...