pub enum PermissionExpr {
Key(PermissionKey),
ScopedKey {
parent: PermissionKey,
key: PermissionKey,
},
All(Vec<Self>),
Any(Vec<Self>),
}Expand description
Boolean permission expression evaluated with tri-state allow/deny/unset semantics.
Variants§
Key(PermissionKey)
Resolves one permission key.
ScopedKey
A child permission that may also inherit a broader parent grant.
Fields
§
parent: PermissionKeyBroad permission accepted as a fallback grant.
§
key: PermissionKeySpecific child permission being checked.
All(Vec<Self>)
Requires every nested expression to allow.
Any(Vec<Self>)
Requires at least one nested expression to allow.
Implementations§
Source§impl PermissionExpr
impl PermissionExpr
Sourcepub const fn key(key: PermissionKey) -> Self
pub const fn key(key: PermissionKey) -> Self
Creates a single-key expression.
Sourcepub const fn scoped_key(parent: PermissionKey, key: PermissionKey) -> Self
pub const fn scoped_key(parent: PermissionKey, key: PermissionKey) -> Self
Creates a child expression with a broad parent fallback.
Trait Implementations§
Source§impl BitAnd for PermissionExpr
impl BitAnd for PermissionExpr
Source§impl BitOr for PermissionExpr
impl BitOr for PermissionExpr
Source§impl Clone for PermissionExpr
impl Clone for PermissionExpr
Source§fn clone(&self) -> PermissionExpr
fn clone(&self) -> PermissionExpr
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PermissionExpr
impl Debug for PermissionExpr
impl Eq for PermissionExpr
Source§impl PartialEq for PermissionExpr
impl PartialEq for PermissionExpr
impl StructuralPartialEq for PermissionExpr
Auto Trait Implementations§
impl Freeze for PermissionExpr
impl RefUnwindSafe for PermissionExpr
impl Send for PermissionExpr
impl Sync for PermissionExpr
impl Unpin for PermissionExpr
impl UnsafeUnpin for PermissionExpr
impl UnwindSafe for PermissionExpr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreWraps this value in an
Arc<SyncMutex<>>