#[non_exhaustive]pub struct DeviceAuthorization {
pub device_code: Secret,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
pub expires_in: u64,
pub interval: u64,
}Expand description
POST /v1/device/authorize: show user_code and verification_uri to the Carbon,
then poll with the device code.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.device_code: SecretPoll the token endpoint with this (sad_…); never show it.
user_code: StringThe code the Carbon confirms on the site, e.g. WDJB-MJHT.
verification_uri: StringWhere the Carbon approves, e.g. https://accounts.teamofsilicons.com/device.
verification_uri_complete: Option<String>The same page with the code filled in.
expires_in: u64Seconds until the codes expire (600).
interval: u64Minimum seconds between polls (5).
Implementations§
Source§impl DeviceAuthorization
impl DeviceAuthorization
Sourcepub fn browser_url(&self) -> &str
pub fn browser_url(&self) -> &str
The URL to open in a browser: the complete one when available.
Trait Implementations§
Source§impl Clone for DeviceAuthorization
impl Clone for DeviceAuthorization
Source§fn clone(&self) -> DeviceAuthorization
fn clone(&self) -> DeviceAuthorization
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeviceAuthorization
impl Debug for DeviceAuthorization
Source§impl<'de> Deserialize<'de> for DeviceAuthorization
impl<'de> Deserialize<'de> for DeviceAuthorization
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceAuthorization, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeviceAuthorization, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DeviceAuthorization
impl PartialEq for DeviceAuthorization
Source§impl Serialize for DeviceAuthorization
impl Serialize for DeviceAuthorization
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for DeviceAuthorization
Auto Trait Implementations§
impl Freeze for DeviceAuthorization
impl RefUnwindSafe for DeviceAuthorization
impl Send for DeviceAuthorization
impl Sync for DeviceAuthorization
impl Unpin for DeviceAuthorization
impl UnsafeUnpin for DeviceAuthorization
impl UnwindSafe for DeviceAuthorization
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