pub struct Token {
pub access_token: String,
pub refresh_token: String,
pub ikm: Vec<u8>,
pub signature: Vec<u8>,
pub expires_at: u64,
}
Fields
access_token: String
refresh_token: String
ikm: Vec<u8>
signature: Vec<u8>
expires_at: u64
Implementations
sourceimpl Token
impl Token
sourcepub fn from(
access_token: String,
refresh_token: String,
ikm: Vec<u8>,
signature: Vec<u8>,
expires_at: u64
) -> Result<Token, Error>
pub fn from(
access_token: String,
refresh_token: String,
ikm: Vec<u8>,
signature: Vec<u8>,
expires_at: u64
) -> Result<Token, Error>
Creates a new token from the provided values
sourcepub fn from_json(json: Value) -> Result<Self, Error>
pub fn from_json(json: Value) -> Result<Self, Error>
Given a serde_json::Value, will attempt to return a token
sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true of the token is expired If the token is expired, it should be discarded
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more