pub struct DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>{ /* private fields */ }
Expand description
The request for an device access token from the authorization server.
Implementations§
Source§impl<'a, 'b, TR, TT, EF> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>
impl<'a, 'b, TR, TT, EF> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>
Sourcepub fn add_extra_param<N, V>(self, name: N, value: V) -> Self
pub fn add_extra_param<N, V>(self, name: N, value: V) -> Self
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.
Sourcepub fn set_time_fn<T>(self, time_fn: T) -> Self
pub fn set_time_fn<T>(self, time_fn: T) -> Self
Specifies a function for returning the current time.
This function is used while polling the authorization server.
Sourcepub fn set_max_backoff_interval(self, interval: Duration) -> Self
pub fn set_max_backoff_interval(self, interval: Duration) -> Self
Sets the upper limit of the sleep interval to use for polling the token endpoint when the HTTP client returns an error (e.g., in case of connection timeout).
Sourcepub fn request<F, S, RE>(
self,
http_client: F,
sleep_fn: S,
timeout: Option<Duration>,
) -> Result<TR, RequestTokenError<RE, DeviceCodeErrorResponse>>
pub fn request<F, S, RE>( self, http_client: F, sleep_fn: S, timeout: Option<Duration>, ) -> Result<TR, RequestTokenError<RE, DeviceCodeErrorResponse>>
Synchronously polls the authorization server for a response, waiting using a user defined sleep function.
Sourcepub 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§
Source§impl<'a, 'b, TR, TT, EF> Clone for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>where
TR: TokenResponse<TT> + Clone,
TT: TokenType + Clone,
EF: ExtraDeviceAuthorizationFields + Clone,
impl<'a, 'b, TR, TT, EF> Clone for DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>where
TR: TokenResponse<TT> + Clone,
TT: TokenType + Clone,
EF: ExtraDeviceAuthorizationFields + Clone,
Source§fn clone(&self) -> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>
fn clone(&self) -> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more