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

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

A request for a resource, utilizing a bearer token.

Example

Here is a way to test an authorizing request against an actix recipient.

use oxide_auth::frontends::actix::{Grant, OAuth, OAuthError, OAuthResponse, ResourceProtection};
use oxide_auth::frontends::actix::message::Resource;

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

Trait Implementations

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

type Result = Result<Grant, ResourceProtection<W::Response>>

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

impl<W, P, E> Handler<Resource<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<Grant, ResourceProtection<W::Response>>

The type of value that this handle will return

Auto Trait Implementations

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

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

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

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

impl<W> UnwindSafe for Resource<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,