pub struct TokenData {
pub access_token: String,
pub refresh_token: Option<String>,
pub token_type: String,
pub expires_in: u64,
pub scope: Option<String>,
pub user_type: Option<String>,
pub company_id: Option<String>,
pub location_id: Option<String>,
pub issued_at: Option<u64>,
}Fields§
§access_token: String§refresh_token: Option<String>§token_type: String§expires_in: u64§scope: Option<String>§user_type: Option<String>§company_id: Option<String>§location_id: Option<String>§issued_at: Option<u64>Unix timestamp (seconds) when this token was issued, for expiry tracking.
Serialized so restored tokens keep correct expiry. None means expiry is
unchecked until mark_issued_now() is called.
Implementations§
Source§impl TokenData
impl TokenData
pub fn is_expired(&self) -> bool
pub fn mark_issued_now(&mut self)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TokenData
impl<'de> Deserialize<'de> for TokenData
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 TokenData
impl RefUnwindSafe for TokenData
impl Send for TokenData
impl Sync for TokenData
impl Unpin for TokenData
impl UnsafeUnpin for TokenData
impl UnwindSafe for TokenData
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