[][src]Trait oxide_auth::endpoint::WebResponse

pub trait WebResponse {
    type Error;
    fn ok(&mut self) -> Result<(), Self::Error>;
fn redirect(&mut self, url: Url) -> Result<(), Self::Error>;
fn client_error(&mut self) -> Result<(), Self::Error>;
fn unauthorized(&mut self, header_value: &str) -> Result<(), Self::Error>;
fn body_text(&mut self, text: &str) -> Result<(), Self::Error>;
fn body_json(&mut self, data: &str) -> Result<(), Self::Error>; }

Response representation into which the Request is transformed by the code_grant types.

At most one of the methods body_text, body_json will be called. Some flows will however not call any of those methods.

Associated Types

type Error

The error generated when trying to construct an unhandled or invalid response.

Loading content...

Required methods

fn ok(&mut self) -> Result<(), Self::Error>

Set the response status to 200.

fn redirect(&mut self, url: Url) -> Result<(), Self::Error>

A response which will redirect the user-agent to which the response is issued.

fn client_error(&mut self) -> Result<(), Self::Error>

Set the response status to 400.

fn unauthorized(&mut self, header_value: &str) -> Result<(), Self::Error>

Set the response status to 401 and add a WWW-Authenticate header.

fn body_text(&mut self, text: &str) -> Result<(), Self::Error>

A pure text response with no special media type set.

fn body_json(&mut self, data: &str) -> Result<(), Self::Error>

Json repsonse data, with media type `aplication/json.

Loading content...

Implementations on Foreign Types

impl WebResponse for Response[src]

type Error = Error

impl WebResponse for Response[src]

type Error = WebError

impl<'r> WebResponse for Response<'r>[src]

type Error = WebError

Loading content...

Implementors

impl WebResponse for OAuthResponse[src]

type Error = OAuthError

impl WebResponse for oxide_auth::frontends::simple::request::Response[src]

type Error = NoError

fn redirect(&mut self, url: Url) -> Result<(), Self::Error>[src]

A response which will redirect the user-agent to which the response is issued.

fn client_error(&mut self) -> Result<(), Self::Error>[src]

Set the response status to 400.

fn unauthorized(&mut self, header_value: &str) -> Result<(), Self::Error>[src]

Set the response status to 401 and add a WWW-Authenticate header.

fn body_text(&mut self, text: &str) -> Result<(), Self::Error>[src]

A pure text response with no special media type set.

fn body_json(&mut self, data: &str) -> Result<(), Self::Error>[src]

Json repsonse data, with media type `aplication/json.

impl<W: WebResponse, F, T> WebResponse for MapErr<W, F, T> where
    F: FnMut(W::Error) -> T, 
[src]

type Error = T

fn redirect(&mut self, url: Url) -> Result<(), Self::Error>[src]

A response which will redirect the user-agent to which the response is issued.

fn client_error(&mut self) -> Result<(), Self::Error>[src]

Set the response status to 400.

fn unauthorized(&mut self, header_value: &str) -> Result<(), Self::Error>[src]

Set the response status to 401 and add a WWW-Authenticate header.

fn body_text(&mut self, text: &str) -> Result<(), Self::Error>[src]

A pure text response with no special media type set.

fn body_json(&mut self, data: &str) -> Result<(), Self::Error>[src]

Json repsonse data, with media type `aplication/json.

Loading content...