Struct rspotify_model::auth::Token [−][src]
pub struct Token {
pub access_token: String,
pub expires_in: Duration,
pub expires_at: Option<DateTime<Utc>>,
pub refresh_token: Option<String>,
pub scopes: HashSet<String>,
}Expand description
Spotify access token information
Fields
access_token: StringAn access token that can be provided in subsequent calls
expires_in: DurationThe time period for which the access token is valid.
expires_at: Option<DateTime<Utc>>The valid time for which the access token is available represented in ISO 8601 combined date and time.
refresh_token: Option<String>A token that can be sent to the Spotify Accounts service in place of an authorization code
scopes: HashSet<String>A list of scopes
which have been granted for this access_token
You may use the scopes! macro in
rspotify-macros to build it at
compile time easily.
Implementations
Tries to initialize the token from a cache file.
Saves the token information into its cache file.
Check if the token is expired. It includes a margin of 10 seconds (which is how much a request would take in the worst case scenario).
Generates an HTTP token authorization header with proper formatting
Trait Implementations
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 RefUnwindSafe for Token
impl UnwindSafe for Token
Blanket Implementations
Mutably borrows from an owned value. Read more