#[non_exhaustive]pub struct TokenSet {
pub access_token: Secret,
pub refresh_token: Secret,
pub rotated: bool,
pub expires_in: Option<Duration>,
pub expires_at: Option<SystemTime>,
pub refresh_token_expires_at: Option<SystemTime>,
pub refresh_token_expires_in: Option<Duration>,
pub scopes: Vec<String>,
pub token_type: Option<String>,
}Expand description
A refreshed login: what to store in place of the old tokens.
The refresh token rotates: the one posted is spent. Store
TokenSet::refresh_token only if the stored one is still the one you
posted (compare-and-swap); if another process already stored a newer
pair, keep that one instead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.access_token: SecretThe new access token.
refresh_token: SecretThe refresh token to store: the new one, or the posted one if the
response didn’t rotate it (see TokenSet::rotated).
rotated: boolWhether the response carried a new refresh token.
expires_in: Option<Duration>The access token’s lifetime, as the response gave it. None if the
response had no readable expires_in: treat the token’s expiry as
unknown (use it until a call is refused, then refresh).
expires_at: Option<SystemTime>When the access token expires: the response’s time plus
TokenSet::expires_in. None when that is unknown or too far out
to represent.
refresh_token_expires_at: Option<SystemTime>When the new refresh token expires, if the response said.
refresh_token_expires_in: Option<Duration>The new refresh token’s lifetime, as the response gave it
(refresh_token_expires_in), if it did.
scopes: Vec<String>The granted scopes (empty if the response didn’t say).
token_type: Option<String>The token type (Bearer), if the response said.