Struct aws_smithy_runtime_api::client::identity::Identity
source · pub struct Identity { /* private fields */ }
Available on crate feature
client
only.Expand description
An identity that can be used for authentication.
The Identity
is a container for any arbitrary identity data that may be used
by a Sign
implementation. Under the hood, it
has an Arc<dyn Any>
, and it is the responsibility of the signer to downcast
to the appropriate data type using the data()
function.
The Identity
also holds an optional expiration time, which may duplicate
an expiration time on the identity data. This is because an Arc<dyn Any>
can’t be downcast to any arbitrary trait, and expiring identities are
common enough to be built-in.
Implementations§
source§impl Identity
impl Identity
sourcepub fn new<T>(data: T, expiration: Option<SystemTime>) -> Self
pub fn new<T>(data: T, expiration: Option<SystemTime>) -> Self
Creates a new identity with the given data and expiration time.
sourcepub fn data<T: Any + Debug + Send + Sync + 'static>(&self) -> Option<&T>
pub fn data<T: Any + Debug + Send + Sync + 'static>(&self) -> Option<&T>
Returns the raw identity data.
sourcepub fn expiration(&self) -> Option<SystemTime>
pub fn expiration(&self) -> Option<SystemTime>
Returns the expiration time for this identity, if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl !RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl !UnwindSafe for Identity
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.