pub struct FederatedUser { /* private fields */ }
Expand description
Details about an AWS IAM federated user.
FederatedUser structs are immutable.
Implementations§
source§impl FederatedUser
impl FederatedUser
sourcepub fn new(
partition: &str,
account_id: &str,
user_name: &str
) -> Result<Self, PrincipalError>
pub fn new(
partition: &str,
account_id: &str,
user_name: &str
) -> Result<Self, PrincipalError>
Create a FederatedUser object.
partition
: The partition this principal exists in.account_id
: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.user_name
: The name of the federated user. This must meet the following requirements or a PrincipalError::InvalidFederatedUserName error will be returned:- The name must contain between 2 and 32 characters.
- The name must be composed to ASCII alphanumeric characters or one of
, - . = @ _
.
If all of the requirements are met, a FederatedUser object is returned. Otherwise, a PrincipalError error is returned.
Example
let federated_user = FederatedUser::new("aws", "123456789012", "user@example.com").unwrap();
assert_eq!(federated_user.partition(), "aws");
assert_eq!(federated_user.account_id(), "123456789012");
assert_eq!(federated_user.user_name(), "user@example.com");
sourcepub fn account_id(&self) -> &str
pub fn account_id(&self) -> &str
The account ID of the user.
Trait Implementations§
source§impl Clone for FederatedUser
impl Clone for FederatedUser
source§fn clone(&self) -> FederatedUser
fn clone(&self) -> FederatedUser
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 FederatedUser
impl Debug for FederatedUser
source§impl Display for FederatedUser
impl Display for FederatedUser
source§impl From<&FederatedUser> for Arn
impl From<&FederatedUser> for Arn
source§fn from(user: &FederatedUser) -> Arn
fn from(user: &FederatedUser) -> Arn
Converts to this type from the input type.
source§impl From<FederatedUser> for Principal
impl From<FederatedUser> for Principal
source§fn from(user: FederatedUser) -> Self
fn from(user: FederatedUser) -> Self
Converts to this type from the input type.
source§impl From<FederatedUser> for PrincipalIdentity
impl From<FederatedUser> for PrincipalIdentity
Wrap a FederatedUser in a PrincipalIdentity.
source§fn from(federated_user: FederatedUser) -> Self
fn from(federated_user: FederatedUser) -> Self
Converts to this type from the input type.
source§impl Hash for FederatedUser
impl Hash for FederatedUser
source§impl Ord for FederatedUser
impl Ord for FederatedUser
source§fn cmp(&self, other: &FederatedUser) -> Ordering
fn cmp(&self, other: &FederatedUser) -> 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<FederatedUser> for FederatedUser
impl PartialEq<FederatedUser> for FederatedUser
source§fn eq(&self, other: &FederatedUser) -> bool
fn eq(&self, other: &FederatedUser) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<FederatedUser> for FederatedUser
impl PartialOrd<FederatedUser> for FederatedUser
source§fn partial_cmp(&self, other: &FederatedUser) -> Option<Ordering>
fn partial_cmp(&self, other: &FederatedUser) -> 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