pub struct SecretValue {
value: String,
expiration: u64,
}Expand description
A cached IAM bearer token together with its UNIX expiry timestamp.
Fields§
§value: String§expiration: u64Implementations§
Source§impl SecretValue
impl SecretValue
Sourcepub fn new(value: String, expiration: u64) -> Self
pub fn new(value: String, expiration: u64) -> Self
Create a new secret with value that expires at the given UNIX timestamp.
Sourcepub fn get_expiration(&self) -> u64
pub fn get_expiration(&self) -> u64
Return the UNIX expiry timestamp.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the token has expired (with a 5-minute safety buffer).
Trait Implementations§
Source§impl Clone for SecretValue
impl Clone for SecretValue
Source§fn clone(&self) -> SecretValue
fn clone(&self) -> SecretValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SecretValue
impl RefUnwindSafe for SecretValue
impl Send for SecretValue
impl Sync for SecretValue
impl Unpin for SecretValue
impl UnsafeUnpin for SecretValue
impl UnwindSafe for SecretValue
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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