pub struct DeviceAuthorizationRequest<'a, TE>where
TE: ErrorResponse,{ /* private fields */ }
Expand description
The request for a set of verification codes from the authorization server.
Implementations§
Source§impl<'a, TE> DeviceAuthorizationRequest<'a, TE>where
TE: ErrorResponse + 'static,
impl<'a, TE> DeviceAuthorizationRequest<'a, TE>where
TE: ErrorResponse + 'static,
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 add_scopes<I>(self, scopes: I) -> Selfwhere
I: IntoIterator<Item = Scope>,
pub fn add_scopes<I>(self, scopes: I) -> Selfwhere
I: IntoIterator<Item = Scope>,
Appends a collection of scopes to the token request.
Sourcepub fn request<F, RE, EF>(
self,
http_client: F,
) -> Result<DeviceAuthorizationResponse<EF>, RequestTokenError<RE, TE>>where
F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>,
RE: Error + 'static,
EF: ExtraDeviceAuthorizationFields,
pub fn request<F, RE, EF>(
self,
http_client: F,
) -> Result<DeviceAuthorizationResponse<EF>, RequestTokenError<RE, TE>>where
F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>,
RE: Error + 'static,
EF: ExtraDeviceAuthorizationFields,
Synchronously sends the request to the authorization server and awaits a response.
Sourcepub async fn request_async<C, F, RE, EF>(
self,
http_client: C,
) -> Result<DeviceAuthorizationResponse<EF>, RequestTokenError<RE, TE>>where
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: Error + 'static,
EF: ExtraDeviceAuthorizationFields,
pub async fn request_async<C, F, RE, EF>(
self,
http_client: C,
) -> Result<DeviceAuthorizationResponse<EF>, RequestTokenError<RE, TE>>where
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: Error + 'static,
EF: ExtraDeviceAuthorizationFields,
Asynchronously sends the request to the authorization server and returns a Future.
Trait Implementations§
Auto Trait Implementations§
impl<'a, TE> Freeze for DeviceAuthorizationRequest<'a, TE>
impl<'a, TE> RefUnwindSafe for DeviceAuthorizationRequest<'a, TE>where
TE: RefUnwindSafe,
impl<'a, TE> Send for DeviceAuthorizationRequest<'a, TE>where
TE: Send,
impl<'a, TE> Sync for DeviceAuthorizationRequest<'a, TE>where
TE: Sync,
impl<'a, TE> Unpin for DeviceAuthorizationRequest<'a, TE>where
TE: Unpin,
impl<'a, TE> UnwindSafe for DeviceAuthorizationRequest<'a, TE>where
TE: UnwindSafe,
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
Mutably borrows from an owned value. Read more