[][src]Trait tide::error::ResultExt

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

Extends the Result type with convenient methods for constructing Tide errors.

Required methods

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

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

Loading content...

Provided methods

fn client_err(self) -> EndpointResult<T>

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

fn server_err(self) -> EndpointResult<T>

Convert to an EndpointResult, 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]

fn client_err(self) -> EndpointResult<T>[src]

fn server_err(self) -> EndpointResult<T>[src]

Loading content...

Implementors

Loading content...