pub struct CanonicalUser { /* private fields */ }
Expand description
Details about an S3 canonical user.
CanonicalUser structs are immutable.
Implementations§
source§impl CanonicalUser
impl CanonicalUser
sourcepub fn new(canonical_user_id: &str) -> Result<Self, PrincipalError>
pub fn new(canonical_user_id: &str) -> Result<Self, PrincipalError>
Create a CanonicalUser object.
Arguments
canonical_user_id
: The canonical user id. This must be a 64 character hex string in lower-case form.
If all of the requirements are met, a CanonicalUser object is returned. Otherwise, a PrincipalError error is returned.
Example
let canonical_user = CanonicalUser::new("9da4bcba2132ad952bba3c8ecb37e668d99b310ce313da30c98aba4cdf009a7d").unwrap();
assert_eq!(canonical_user.canonical_user_id(), "9da4bcba2132ad952bba3c8ecb37e668d99b310ce313da30c98aba4cdf009a7d");
sourcepub fn canonical_user_id(&self) -> &str
pub fn canonical_user_id(&self) -> &str
The canonical user id.
Trait Implementations§
source§impl Clone for CanonicalUser
impl Clone for CanonicalUser
source§fn clone(&self) -> CanonicalUser
fn clone(&self) -> CanonicalUser
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 CanonicalUser
impl Debug for CanonicalUser
source§impl Display for CanonicalUser
impl Display for CanonicalUser
source§impl From<CanonicalUser> for Principal
impl From<CanonicalUser> for Principal
source§fn from(user: CanonicalUser) -> Self
fn from(user: CanonicalUser) -> Self
Converts to this type from the input type.
source§impl From<CanonicalUser> for PrincipalIdentity
impl From<CanonicalUser> for PrincipalIdentity
Wrap a CanonicalUser in a PrincipalIdentity.
source§fn from(canonical_user: CanonicalUser) -> Self
fn from(canonical_user: CanonicalUser) -> Self
Converts to this type from the input type.
source§impl Hash for CanonicalUser
impl Hash for CanonicalUser
source§impl Ord for CanonicalUser
impl Ord for CanonicalUser
source§fn cmp(&self, other: &CanonicalUser) -> Ordering
fn cmp(&self, other: &CanonicalUser) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<CanonicalUser> for CanonicalUser
impl PartialEq<CanonicalUser> for CanonicalUser
source§fn eq(&self, other: &CanonicalUser) -> bool
fn eq(&self, other: &CanonicalUser) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CanonicalUser> for CanonicalUser
impl PartialOrd<CanonicalUser> for CanonicalUser
source§fn partial_cmp(&self, other: &CanonicalUser) -> Option<Ordering>
fn partial_cmp(&self, other: &CanonicalUser) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more