pub struct SecurityToken { /* private fields */ }
Expand description
Security token.
Implementations§
Source§impl SecurityToken
impl SecurityToken
Sourcepub fn try_new(
access_key_id: AccessKeyId,
expires_at: DateTime,
key: impl AsRef<[u8]>,
) -> Result<Self, Error>
pub fn try_new( access_key_id: AccessKeyId, expires_at: DateTime, key: impl AsRef<[u8]>, ) -> Result<Self, Error>
Attempts to create a new instance.
Sourcepub fn access_key_id(&self) -> &AccessKeyId
pub fn access_key_id(&self) -> &AccessKeyId
Returns the access key ID.
Sourcepub fn expires_at(&self) -> DateTime
pub fn expires_at(&self) -> DateTime
Returns the expires time.
Sourcepub fn expires_in(&self) -> Duration
pub fn expires_in(&self) -> Duration
Returns the time when the security token will expire in.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true
if the security token has expired.
Sourcepub fn parse_with(
token: String,
key: &[u8],
) -> Result<Self, ParseSecurityTokenError>
pub fn parse_with( token: String, key: &[u8], ) -> Result<Self, ParseSecurityTokenError>
Parses the token with the encryption key.
Trait Implementations§
Source§impl AsRef<[u8]> for SecurityToken
impl AsRef<[u8]> for SecurityToken
Source§impl Clone for SecurityToken
impl Clone for SecurityToken
Source§fn clone(&self) -> SecurityToken
fn clone(&self) -> SecurityToken
Returns a copy 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 moreSource§impl Debug for SecurityToken
impl Debug for SecurityToken
Auto Trait Implementations§
impl Freeze for SecurityToken
impl RefUnwindSafe for SecurityToken
impl Send for SecurityToken
impl Sync for SecurityToken
impl Unpin for SecurityToken
impl UnwindSafe for SecurityToken
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)