Trait oxide_auth::code_grant::frontend::WebResponse [] [src]

pub trait WebResponse where
    Self: Sized
{ type Error: From<OAuthError>; fn redirect(url: Url) -> Result<Self, Self::Error>;
fn text(text: &str) -> Result<Self, Self::Error>;
fn json(data: &str) -> Result<Self, Self::Error>;
fn as_client_error(self) -> Result<Self, Self::Error>;
fn as_unauthorized(self) -> Result<Self, Self::Error>;
fn with_authorization(self, kind: &str) -> Result<Self, Self::Error>; fn redirect_error(target: ErrorUrl) -> Result<Self, Self::Error> { ... } }

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

Associated Types

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

Required Methods

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

A pure text response with no special media type set.

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

Set the response status to 400

Set the response status to 401

Add an Authorization header

Provided Methods

Construct a redirect for the error. Here the response may choose to augment the error with additional information (such as help websites, description strings), hence the default implementation which does not do any of that.

Implementations on Foreign Types

impl WebResponse for Response
[src]

Implementors