Struct scratchstack_aws_principal::User
source · [−]pub struct User { /* private fields */ }
Expand description
Details about an AWS IAM user.
Implementations
sourceimpl User
impl User
sourcepub fn new(
partition: &str,
account_id: &str,
path: &str,
user_name: &str
) -> Result<Self, PrincipalError>
pub fn new(
partition: &str,
account_id: &str,
path: &str,
user_name: &str
) -> Result<Self, PrincipalError>
Create a User object.
Arguments
account_id
: The 12 digit account id. This must be composed of 12 ASCII digits or a PrincipalError::InvalidAccountId error will be returned.path
: The IAM path the group is under. This must meet the following requirements or a PrincipalError::InvalidPath error will be returned:- The path must contain between 1 and 512 characters.
- The path must start and end with
/
. - All characters in the path must be in the ASCII range 0x21 (
!
) through 0x7E (~
). The AWS documentation erroneously indicates that 0x7F (DEL) is acceptable; however, the IAM APIs reject this character.
user_name
: The name of the user. This must meet the following requirements or a PrincipalError::InvalidUserName error will be returned:- The name must contain between 1 and 64 characters.
- The name must be composed to ASCII alphanumeric characters or one of
, - . = @ _
.
Return value
If all of the requirements are met, a User object is returned. Otherwise, a PrincipalError error is returned.
pub fn partition(&self) -> &str
pub fn account_id(&self) -> &str
pub fn path(&self) -> &str
pub fn user_name(&self) -> &str
Trait Implementations
sourceimpl From<User> for PrincipalIdentity
impl From<User> for PrincipalIdentity
sourceimpl Ord for User
impl Ord for User
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<User> for User
impl PartialOrd<User> for User
sourcefn partial_cmp(&self, other: &User) -> Option<Ordering>
fn partial_cmp(&self, other: &User) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moreimpl Eq for User
impl StructuralEq for User
impl StructuralPartialEq for User
Auto Trait Implementations
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more