pub struct Renewed {
pub access_token: String,
pub refresh_token: Option<String>,
pub expires_in: i64,
pub refresh_token_expires_in: Option<i64>,
pub scopes: Option<Vec<String>>,
pub at: Option<i64>,
}Expand description
Fresh tokens for a parked login, as the token endpoint returns them.
Fields§
§access_token: String§refresh_token: Option<String>None when the server keeps the refresh token it was given.
expires_in: i64§refresh_token_expires_in: Option<i64>§scopes: Option<Vec<String>>§at: Option<i64>When the server said it was, from the response’s Date header, in epoch seconds.
The lifetimes above are relative, so whatever they are added to decides when the login expires. Adding them to this machine’s clock makes a wrong clock a wrong expiry: running ahead, a freshly renewed park reads as lapsed and every status renews it again, rotating the refresh chain on a loop; running behind, a lapsed park looks restorable and a switch installs a login that cannot work. Anchored to the answer’s own clock, neither happens.
None where the server sent no Date, and then the local clock is all there is.
Trait Implementations§
impl StructuralPartialEq for Renewed
Auto Trait Implementations§
impl Freeze for Renewed
impl RefUnwindSafe for Renewed
impl Send for Renewed
impl Sync for Renewed
impl Unpin for Renewed
impl UnsafeUnpin for Renewed
impl UnwindSafe for Renewed
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