struct
Token
pub struct Token {
pub access_token: String,
pub expires_at: f64,
}An access token and when it expires (seconds on your clock).
Fields
Methods
parse
pub fn parse(res: &Response, now: f64) -> Result<Token, Error>Parse a token reply received at now (seconds). Expiry is brought forward a minute, and capped at 15 minutes (Halaxy's documented lifetime, whatever expires_in says).
is_fresh
pub fn is_fresh(&self, now: f64) -> boolWhether the token is still good at now (seconds since the epoch).