pub struct FileTokenRecord {
pub access_token: String,
pub refresh_token: String,
pub expires_at_unix: u64,
}Expand description
On-disk shape persisted to ${root}/${bearer_id}/.... Public so
adopters can construct records for put() and compare what they
read back from read_record().
Fields§
§access_token: String§refresh_token: String§expires_at_unix: u64Unix epoch seconds at which access_token ceases to be valid.
Stored as u64 (no JSON Number precision loss for any
realistic OAuth expiry).
Implementations§
Source§impl FileTokenRecord
impl FileTokenRecord
pub fn expires_at(&self) -> SystemTime
pub fn from_expires_at( access_token: impl Into<String>, refresh_token: impl Into<String>, expires_at: SystemTime, ) -> Self
Trait Implementations§
Source§impl Clone for FileTokenRecord
impl Clone for FileTokenRecord
Source§fn clone(&self) -> FileTokenRecord
fn clone(&self) -> FileTokenRecord
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 FileTokenRecord
impl Debug for FileTokenRecord
Source§impl<'de> Deserialize<'de> for FileTokenRecord
impl<'de> Deserialize<'de> for FileTokenRecord
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
Source§impl PartialEq for FileTokenRecord
impl PartialEq for FileTokenRecord
Source§fn eq(&self, other: &FileTokenRecord) -> bool
fn eq(&self, other: &FileTokenRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FileTokenRecord
impl Serialize for FileTokenRecord
impl Eq for FileTokenRecord
impl StructuralPartialEq for FileTokenRecord
Auto Trait Implementations§
impl Freeze for FileTokenRecord
impl RefUnwindSafe for FileTokenRecord
impl Send for FileTokenRecord
impl Sync for FileTokenRecord
impl Unpin for FileTokenRecord
impl UnsafeUnpin for FileTokenRecord
impl UnwindSafe for FileTokenRecord
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