pub struct ScopeSet { /* private fields */ }Expand description
The scopes a principal holds.
A u128 bitset for the same reason FeatureProfile
is one: the set is copied into every visibility decision, so it has to be
Copy and eight bytes of comparison beats a HashSet on a path that runs
once per primitive per list.
Implementations§
Source§impl ScopeSet
impl ScopeSet
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
No scopes. The default, so a context built without a set denies everything that requires one.
Sourcepub const fn holds(self, required: Self) -> bool
pub const fn holds(self, required: Self) -> bool
Whether every scope in required is held.
The direction matters: this is “does the principal have everything the primitive needs”, and the subset relation is what makes an empty requirement visible to everyone while a single missing scope hides the primitive from everyone.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The scopes held but not required, and the reverse — for a message that says which side was short.
Trait Implementations§
impl Copy for ScopeSet
impl Eq for ScopeSet
impl StructuralPartialEq for ScopeSet
Auto Trait Implementations§
impl Freeze for ScopeSet
impl RefUnwindSafe for ScopeSet
impl Send for ScopeSet
impl Sync for ScopeSet
impl Unpin for ScopeSet
impl UnsafeUnpin for ScopeSet
impl UnwindSafe for ScopeSet
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