[][src]Struct oxide_auth::frontends::actix::message::AccessToken

pub struct AccessToken<W: WebRequest = ResolvedRequest>(pub W);

A request for a bearer token.

Example

Here is a way to request an access token response from some actix recipient.

use oxide_auth::frontends::actix::{OAuth, OAuthError, OAuthResponse};
use oxide_auth::frontends::actix::message::AccessToken;

fn handle(request: HttpRequest, recipient: Recipient<AccessToken>)
    -> impl Future<Item=OAuthResponse, Error=OAuthError>
{
    request.oauth2()
        .and_then(move |request| recipient
            .send(request.access_token())
            // Merge `MailboxError` and response ´OAuthError`
            .map_err(|_| OAuthError::DenySilently)
            .and_then(|x| x))
}

Trait Implementations

impl<W: WebRequest> Message for AccessToken<W> where
    W: Send + Sync + 'static,
    W::Response: Send + Sync + 'static, 
[src]

type Result = Result<W::Response, W::Error>

The type of value that this message will resolved with if it is successful. Read more

impl<W, P, E> Handler<AccessToken<W>> for AsActor<P> where
    W: WebRequest<Error = E> + Send + Sync + 'static,
    P: Endpoint<W, Error = E> + 'static,
    W::Response: Send + Sync + 'static,
    E: Send + Sync + 'static, 
[src]

type Result = Result<W::Response, W::Error>

The type of value that this handle will return

Auto Trait Implementations

impl<W> Unpin for AccessToken<W> where
    W: Unpin

impl<W> Send for AccessToken<W> where
    W: Send

impl<W> Sync for AccessToken<W> where
    W: Sync

impl<W> RefUnwindSafe for AccessToken<W> where
    W: RefUnwindSafe

impl<W> UnwindSafe for AccessToken<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> UnsafeAny for T where
    T: Any

impl<T> IntoCollection<T> for T

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