pub struct RoleName(/* private fields */);Expand description
A role name, without the role: prefix.
The prefix is the whole reason this is a newtype. Upstream’s _loadRoles returns
'role:' + r (Auth.js:329-331) while getRolesForUser deals in bare names, so a
Vec<String> crossing between them carries no evidence of which form it holds. Getting that
wrong in the unprefixing direction is how a user whose objectId begins with role: comes to
match a role ACL entry, which is the collision upstream guards against separately at
Auth.js:195 and :237.
This type holds the bare name. RoleName::to_principal is the only way to get the prefixed
form, and it produces a Principal rather than a String, so the prefixed spelling exists
in exactly one place.
Implementations§
Trait Implementations§
impl Eq for RoleName
Source§impl Ord for RoleName
impl Ord for RoleName
1.21.0 (const: unstable) · 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 PartialOrd for RoleName
impl PartialOrd for RoleName
impl StructuralPartialEq for RoleName
Auto Trait Implementations§
impl Freeze for RoleName
impl RefUnwindSafe for RoleName
impl Send for RoleName
impl Sync for RoleName
impl Unpin for RoleName
impl UnsafeUnpin for RoleName
impl UnwindSafe for RoleName
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.