Skip to main content

Response

Type Alias Response 

Source
pub type Response = Result<HttpResponse, HttpResponse>;
Expand description

Response type alias - allows using ? operator for early returns

Aliased Type§

pub enum Response {
    Ok(HttpResponse),
    Err(HttpResponse),
}

Variants§

§1.0.0

Ok(HttpResponse)

Contains the success value

§1.0.0

Err(HttpResponse)

Contains the error value

Trait Implementations§

Source§

impl From<AuthorizationError> for Response

Source§

fn from(err: AuthorizationError) -> Response

Converts to this type from the input type.
Source§

impl From<InertiaRedirect<'_>> for Response

Source§

fn from(redirect: InertiaRedirect<'_>) -> Response

Converts to this type from the input type.
Source§

impl From<ParamError> for Response

Source§

fn from(err: ParamError) -> Response

Converts to this type from the input type.
Source§

impl From<Redirect> for Response

Auto-convert Redirect to Response

Source§

fn from(redirect: Redirect) -> Response

Converts to this type from the input type.
Source§

impl From<RedirectRouteBuilder> for Response

Auto-convert RedirectRouteBuilder to Response

Source§

fn from(redirect: RedirectRouteBuilder) -> Response

Converts to this type from the input type.
Source§

impl ResponseExt for Response

Source§

fn status(self, code: u16) -> Self

Source§

fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self