pub struct AuthorizationResponse {
pub device_code: Secret<String>,
pub user_code: String,
pub verification_uri: Url,
pub verification_uri_complete: Option<Url>,
pub expires_in: u64,
pub interval: u64,
}
Expand description
Response from the device authorization endpoint
Fields§
§device_code: Secret<String>
The device code used for polling
user_code: String
The user code to display to the user
verification_uri: Url
The verification URI where the user should go
verification_uri_complete: Option<Url>
Optional complete verification URI with user code embedded
expires_in: u64
How long the device code is valid for
interval: u64
Recommended polling interval in seconds
Implementations§
Source§impl AuthorizationResponse
impl AuthorizationResponse
Sourcepub fn device_code(&self) -> &str
pub fn device_code(&self) -> &str
Get the device code (secret)
Sourcepub fn verification_uri(&self) -> &Url
pub fn verification_uri(&self) -> &Url
Get the verification URI
Sourcepub fn verification_uri_complete(&self) -> Option<&Url>
pub fn verification_uri_complete(&self) -> Option<&Url>
Get the complete verification URI if available
Sourcepub fn expires_in(&self) -> Duration
pub fn expires_in(&self) -> Duration
Get the expiration time as Duration
Sourcepub fn poll_interval(&self) -> Duration
pub fn poll_interval(&self) -> Duration
Get the polling interval as Duration
Sourcepub fn generate_qr_code(&self) -> Result<String, DeviceFlowError>
pub fn generate_qr_code(&self) -> Result<String, DeviceFlowError>
Generate a QR code for the verification URI (requires qr-codes feature)
Trait Implementations§
Source§impl Clone for AuthorizationResponse
impl Clone for AuthorizationResponse
Source§fn clone(&self) -> AuthorizationResponse
fn clone(&self) -> AuthorizationResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AuthorizationResponse
impl Debug for AuthorizationResponse
Source§impl<'de> Deserialize<'de> for AuthorizationResponse
impl<'de> Deserialize<'de> for AuthorizationResponse
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthorizationResponse
impl RefUnwindSafe for AuthorizationResponse
impl Send for AuthorizationResponse
impl Sync for AuthorizationResponse
impl Unpin for AuthorizationResponse
impl UnwindSafe for AuthorizationResponse
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