pub struct Roles(/* private fields */);Expand description
A set of roles. It is written as its roles’ names in the order of
Role::ALL, joined by commas; the empty set is written empty.
Implementations§
Source§impl Roles
impl Roles
Sourcepub fn scopes(self) -> Scopes
pub fn scopes(self) -> Scopes
The scopes of the set: the union of its roles’ scopes
(Role::scopes).
Sourcepub fn within(self, cap: Option<Roles>) -> Roles
pub fn within(self, cap: Option<Roles>) -> Roles
The roles of this set that count in a tenant whose cap is cap:
those the cap holds too, or all of them where the tenant has no
cap.
Sourcepub fn outside(self, cap: Option<Roles>) -> Roles
pub fn outside(self, cap: Option<Roles>) -> Roles
The roles of this set that a tenant whose cap is cap does not
allow; none where the tenant has no cap.
Sourcepub fn caps(self) -> bool
pub fn caps(self) -> bool
Whether the set may be a tenant’s cap: one or more of the roles a tenant membership may hold.
Sourcepub fn named(names: &[String]) -> Option<Roles>
pub fn named(names: &[String]) -> Option<Roles>
The set of the roles names name, in any order and with repeats;
None if one is not a role’s name.
Sourcepub fn parse(text: &str) -> Option<Roles>
pub fn parse(text: &str) -> Option<Roles>
Reads a set as Roles writes it, and nothing else: a row’s roles
in another order, with a repeat, or empty, are damage.
Trait Implementations§
impl Copy for Roles
impl Eq for Roles
impl StructuralPartialEq for Roles
Auto Trait Implementations§
impl Forget for Roles
impl Freeze for Roles
impl Move for Roles
impl RefUnwindSafe for Roles
impl Send for Roles
impl Sync for Roles
impl Unpin for Roles
impl UnsafeUnpin for Roles
impl UnwindSafe for Roles
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> 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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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.
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more