pub struct DeviceCode {
pub device_code: String,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
pub expires_in: Duration,
pub interval: Duration,
}Expand description
Tidal’s answer to POST /device_authorization: what the user must open
and type, and how to poll. Its Debug redacts device_code, which can be
exchanged for tokens until it expires.
Fields§
§device_code: String§user_code: StringThe code the user types on the Tidal page (5 characters).
verification_uri: StringWithout a scheme, e.g. link.tidal.com.
verification_uri_complete: Option<String>The URL with the code, e.g. link.tidal.com/ABCDE, when sent.
expires_in: DurationHow long the code is valid (300 s on the live API).
interval: DurationMinimum wait between polls.
Implementations§
Source§impl DeviceCode
impl DeviceCode
Sourcepub fn from_json(body: &str) -> Result<Self, AuthError>
pub fn from_json(body: &str) -> Result<Self, AuthError>
Parses Tidal’s camelCase device_authorization body.
Sourcepub fn login_link(&self) -> String
pub fn login_link(&self) -> String
The link printed for the user: https:// + verificationUri.
Sourcepub fn browser_link(&self) -> String
pub fn browser_link(&self) -> String
The link opened in a browser: https:// + verificationUriComplete
when sent, else login_link.
Trait Implementations§
Source§impl Clone for DeviceCode
impl Clone for DeviceCode
Source§impl Debug for DeviceCode
impl Debug for DeviceCode
impl Eq for DeviceCode
Source§impl PartialEq for DeviceCode
impl PartialEq for DeviceCode
impl StructuralPartialEq for DeviceCode
Auto Trait Implementations§
impl Freeze for DeviceCode
impl RefUnwindSafe for DeviceCode
impl Send for DeviceCode
impl Sync for DeviceCode
impl Unpin for DeviceCode
impl UnsafeUnpin for DeviceCode
impl UnwindSafe for DeviceCode
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