pub struct DeviceAccessTokenRequest<'a, 'b, TR, EF>where
TR: TokenResponse,
EF: ExtraDeviceAuthorizationFields,{ /* private fields */ }
Expand description
The request for a device access token from the authorization server.
Implementations§
Source§impl<'a, 'b, TR, EF> DeviceAccessTokenRequest<'a, 'b, TR, EF>where
TR: TokenResponse,
EF: ExtraDeviceAuthorizationFields,
impl<'a, 'b, TR, EF> DeviceAccessTokenRequest<'a, 'b, TR, EF>where
TR: TokenResponse,
EF: ExtraDeviceAuthorizationFields,
Sourcepub fn add_extra_param<N, V>(
self,
name: N,
value: V,
) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
pub fn add_extra_param<N, V>( self, name: N, value: V, ) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
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, T>(
self,
time_fn: T,
) -> DeviceAccessTokenRequest<'a, 't, TR, EF>
pub fn set_time_fn<'t, T>( self, time_fn: T, ) -> DeviceAccessTokenRequest<'a, 't, TR, EF>
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,
) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
pub fn set_max_backoff_interval( self, interval: Duration, ) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
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<C, S>(
self,
http_client: &C,
sleep_fn: S,
timeout: Option<Duration>,
) -> Result<TR, RequestTokenError<<C as SyncHttpClient>::Error, StandardErrorResponse<DeviceCodeErrorResponseType>>>
pub fn request<C, S>( self, http_client: &C, sleep_fn: S, timeout: Option<Duration>, ) -> Result<TR, RequestTokenError<<C as SyncHttpClient>::Error, StandardErrorResponse<DeviceCodeErrorResponseType>>>
Synchronously polls the authorization server for a response, waiting using a user defined sleep function.
Sourcepub fn request_async<'c, C, S, SF>(
self,
http_client: &'c C,
sleep_fn: S,
timeout: Option<Duration>,
) -> impl Future<Output = Result<TR, RequestTokenError<<C as AsyncHttpClient<'c>>::Error, StandardErrorResponse<DeviceCodeErrorResponseType>>>> + 'cwhere
DeviceAccessTokenRequest<'a, 'b, TR, EF>: 'c,
C: AsyncHttpClient<'c>,
S: Fn(Duration) -> SF + 'c,
SF: Future<Output = ()>,
pub fn request_async<'c, C, S, SF>(
self,
http_client: &'c C,
sleep_fn: S,
timeout: Option<Duration>,
) -> impl Future<Output = Result<TR, RequestTokenError<<C as AsyncHttpClient<'c>>::Error, StandardErrorResponse<DeviceCodeErrorResponseType>>>> + 'cwhere
DeviceAccessTokenRequest<'a, 'b, TR, EF>: 'c,
C: AsyncHttpClient<'c>,
S: Fn(Duration) -> SF + 'c,
SF: Future<Output = ()>,
Asynchronously sends the request to the authorization server and awaits a response.
Trait Implementations§
Source§impl<'a, 'b, TR, EF> Clone for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> Clone for DeviceAccessTokenRequest<'a, 'b, TR, EF>
Source§fn clone(&self) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
fn clone(&self) -> DeviceAccessTokenRequest<'a, 'b, TR, EF>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a, 'b, TR, EF> Freeze for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> !RefUnwindSafe for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> Send for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> Sync for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> Unpin for DeviceAccessTokenRequest<'a, 'b, TR, EF>
impl<'a, 'b, TR, EF> !UnwindSafe for DeviceAccessTokenRequest<'a, 'b, TR, EF>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more