[][src]Struct oauth2::DeviceAccessTokenRequest

pub struct DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    TR: TokenResponse<TT>,
    TT: TokenType,
    EF: ExtraDeviceAuthorizationFields
{ /* fields omitted */ }

The request for an device access token from the authorization server.

See https://tools.ietf.org/html/rfc8628#section-3.4.

Implementations

impl<'a, 'b, TR, TT, EF> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    TR: TokenResponse<TT>,
    TT: TokenType,
    EF: ExtraDeviceAuthorizationFields
[src]

pub fn add_extra_param<N, V>(self, name: N, value: V) -> Self where
    N: Into<Cow<'a, str>>,
    V: Into<Cow<'a, str>>, 
[src]

Appends an extra param to the token request.

This method allows extensions to be used without direct support from this crate. If name conflicts with a parameter managed by this crate, the behavior is undefined. In particular, do not set parameters defined by RFC 6749 or RFC 7636.

Security Warning

Callers should follow the security recommendations for any OAuth2 extensions used with this function, which are beyond the scope of RFC 6749.

pub fn set_time_fn<T>(self, time_fn: T) -> Self where
    T: Fn() -> DateTime<Utc> + 'b + Send + Sync
[src]

Specifies a function for returning the current time.

This function is used while polling the authorization server.

pub fn request<F, S, RE>(
    self,
    http_client: F,
    sleep_fn: S,
    timeout: Option<Duration>
) -> Result<TR, RequestTokenError<RE, DeviceCodeErrorResponse>> where
    F: Fn(HttpRequest) -> Result<HttpResponse, RE>,
    S: Fn(Duration),
    RE: Error + 'static, 
[src]

Synchronously polls the authorization server for a response, waiting using a user defined sleep function.

pub async fn request_async<C, F, S, SF, RE>(
    self,
    http_client: C,
    sleep_fn: S,
    timeout: Option<Duration>
) -> Result<TR, RequestTokenError<RE, DeviceCodeErrorResponse>> where
    C: Fn(HttpRequest) -> F,
    F: Future<Output = Result<HttpResponse, RE>>,
    S: Fn(Duration) -> SF,
    SF: Future<Output = ()>,
    RE: Error + 'static, 
[src]

Asynchronously sends the request to the authorization server and awaits a response.

Trait Implementations

impl<'a, 'b, TR: Clone, TT: Clone, EF: Clone> Clone for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    TR: TokenResponse<TT>,
    TT: TokenType,
    EF: ExtraDeviceAuthorizationFields
[src]

Auto Trait Implementations

impl<'a, 'b, TR, TT, EF> !RefUnwindSafe for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>

impl<'a, 'b, TR, TT, EF> Send for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    EF: Send + Sync,
    TR: Send,
    TT: Send

impl<'a, 'b, TR, TT, EF> Sync for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    EF: Sync,
    TR: Sync,
    TT: Sync

impl<'a, 'b, TR, TT, EF> Unpin for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
    EF: Unpin,
    TR: Unpin,
    TT: Unpin

impl<'a, 'b, TR, TT, EF> !UnwindSafe for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,