Struct oauth2::DeviceAccessTokenRequest [−][src]
pub struct DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
TR: TokenResponse<TT>,
TT: TokenType,
EF: ExtraDeviceAuthorizationFields, { /* fields omitted */ }
Expand description
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,
impl<'a, 'b, TR, TT, EF> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF> where
TR: TokenResponse<TT>,
TT: TokenType,
EF: ExtraDeviceAuthorizationFields,
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.
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,
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,
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,
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,
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,
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,
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
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V