Struct oxide_auth_actix::OAuthRequest
source · pub struct OAuthRequest { /* private fields */ }
Expand description
Type implementing WebRequest
as well as FromRequest
for use in route handlers
This type consumes the body of the HttpRequest upon extraction, so be careful not to use it in places you also expect an application payload
Implementations§
source§impl OAuthRequest
impl OAuthRequest
sourcepub async fn new(req: HttpRequest, payload: Payload) -> Result<Self, WebError>
pub async fn new(req: HttpRequest, payload: Payload) -> Result<Self, WebError>
Create a new OAuthRequest from an HttpRequest and Payload
Fetch the authorization header from the request
sourcepub fn query(&self) -> Option<&NormalizedParameter>
pub fn query(&self) -> Option<&NormalizedParameter>
Fetch the query for this request
sourcepub fn query_mut(&mut self) -> Option<&mut NormalizedParameter>
pub fn query_mut(&mut self) -> Option<&mut NormalizedParameter>
Fetch the query mutably
sourcepub fn body(&self) -> Option<&NormalizedParameter>
pub fn body(&self) -> Option<&NormalizedParameter>
Fetch the body of the request
Trait Implementations§
source§impl Clone for OAuthRequest
impl Clone for OAuthRequest
source§fn clone(&self) -> OAuthRequest
fn clone(&self) -> OAuthRequest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OAuthRequest
impl Debug for OAuthRequest
source§impl From<OAuthResource> for OAuthRequest
impl From<OAuthResource> for OAuthRequest
source§fn from(o: OAuthResource) -> Self
fn from(o: OAuthResource) -> Self
Converts to this type from the input type.
source§impl FromRequest for OAuthRequest
impl FromRequest for OAuthRequest
§type Future = Pin<Box<dyn Future<Output = Result<OAuthRequest, <OAuthRequest as FromRequest>::Error>>>>
type Future = Pin<Box<dyn Future<Output = Result<OAuthRequest, <OAuthRequest as FromRequest>::Error>>>>
Future that resolves to a
Self
. Read moresource§fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future
Create a
Self
from request parts asynchronously.source§impl WebRequest for OAuthRequest
impl WebRequest for OAuthRequest
§type Response = OAuthResponse
type Response = OAuthResponse
The corresponding type of Responses returned from this module.
source§fn query(
&mut self
) -> Result<Cow<'_, dyn QueryParameter + 'static>, Self::Error>
fn query( &mut self ) -> Result<Cow<'_, dyn QueryParameter + 'static>, Self::Error>
Retrieve a parsed version of the url query. Read more
Auto Trait Implementations§
impl Freeze for OAuthRequest
impl RefUnwindSafe for OAuthRequest
impl Send for OAuthRequest
impl Sync for OAuthRequest
impl Unpin for OAuthRequest
impl UnwindSafe for OAuthRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more