[−][src]Struct oauth2::DeviceAccessTokenRequest
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]
TR: TokenResponse<TT>,
TT: TokenType,
EF: ExtraDeviceAuthorizationFields,
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]
N: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
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]
T: Fn() -> DateTime<Utc> + 'b + Send + Sync,
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]
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,
[src]
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,
[src]
TR: TokenResponse<TT>,
TT: TokenType,
EF: ExtraDeviceAuthorizationFields,
fn clone(&self) -> DeviceAccessTokenRequest<'a, 'b, TR, TT, EF>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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,
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,
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,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,