Struct oxide_auth_rocket::OAuthRequest

source ·
pub struct OAuthRequest<'r> { /* private fields */ }
Expand description

Request guard that also buffers OAuth data internally.

Implementations§

source§

impl<'r> OAuthRequest<'r>

source

pub fn new<'a>(request: &'a Request<'r>) -> Self

Create the request data from request headers.

Some oauth methods need additionally the body data which you can attach later.

source

pub fn add_body(&mut self, data: Data)

Provide the body of the request.

Some, but not all operations, require reading their data from a urlencoded POST body. To simplify the implementation of primitives and handlers, this type is the central request type for both these use cases. When you forget to provide the body to a request, the oauth system will return an error the moment the request is used.

Trait Implementations§

source§

impl<'a, 'r> FromRequest<'a, 'r> for OAuthRequest<'r>

§

type Error = NoError

The associated error to be returned if derivation fails.
source§

fn from_request( request: &'a Request<'r> ) -> Outcome<Self, (Status, Self::Error), ()>

Derives an instance of Self from the incoming request metadata. Read more
source§

impl<'r> WebRequest for OAuthRequest<'r>

§

type Error = WebError

The error generated from access of malformed or invalid requests.
§

type Response = OAuthResponse<'r>

The corresponding type of Responses returned from this module.
source§

fn query( &mut self ) -> Result<Cow<'_, dyn QueryParameter + 'static>, Self::Error>

Retrieve a parsed version of the url query. Read more
source§

fn urlbody( &mut self ) -> Result<Cow<'_, dyn QueryParameter + 'static>, Self::Error>

Retrieve the parsed application/x-form-urlencoded body of the request. Read more
source§

fn authheader(&mut self) -> Result<Option<Cow<'_, str>>, Self::Error>

Contents of the authorization header or none if none exists. An Err value indicates a malformed header or request.

Auto Trait Implementations§

§

impl<'r> Freeze for OAuthRequest<'r>

§

impl<'r> RefUnwindSafe for OAuthRequest<'r>

§

impl<'r> Send for OAuthRequest<'r>

§

impl<'r> Sync for OAuthRequest<'r>

§

impl<'r> Unpin for OAuthRequest<'r>

§

impl<'r> UnwindSafe for OAuthRequest<'r>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T, I> AsResult<T, I> for T
where I: Input,

source§

fn as_result(self) -> Result<T, ParseErr<I>>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoCollection<T> for T

source§

fn into_collection<A>(self) -> SmallVec<A>
where A: Array<Item = T>,

Converts self into a collection.
source§

fn mapped<U, F, A>(self, f: F) -> SmallVec<A>
where F: FnMut(T) -> U, A: Array<Item = U>,

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Typeable for T
where T: Any,

source§

fn get_type(&self) -> TypeId

Get the TypeId of this object.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V