pub struct PrimitiveMeta { /* private fields */ }Expand description
What the registry must know about a primitive to decide who may see it.
Split from the primitive itself so the visibility predicate reads two small values instead of a variant, and so a caller that already has the metadata does not have to hold the whole tool to ask whether it is visible.
Deliberately not Default: a default would have to name one of the four
kinds, and a metadata value that silently claims to be a tool is worse than
one that does not exist.
Implementations§
Source§impl PrimitiveMeta
impl PrimitiveMeta
Sourcepub const fn new(kind: PrimitiveKind) -> Self
pub const fn new(kind: PrimitiveKind) -> Self
Metadata for a primitive that needs nothing: every session with any principal sees it.
Sourcepub const fn requires(self, features: FeatureSet) -> Self
pub const fn requires(self, features: FeatureSet) -> Self
The features a session must have.
Sourcepub const fn kind(self) -> PrimitiveKind
pub const fn kind(self) -> PrimitiveKind
Which list it belongs to.
Sourcepub const fn required_features(self) -> FeatureSet
pub const fn required_features(self) -> FeatureSet
What a session must be able to do.
Sourcepub const fn required_scopes(self) -> ScopeSet
pub const fn required_scopes(self) -> ScopeSet
What a principal must hold.
Trait Implementations§
Source§impl Clone for PrimitiveMeta
impl Clone for PrimitiveMeta
impl Copy for PrimitiveMeta
Source§impl Debug for PrimitiveMeta
impl Debug for PrimitiveMeta
impl Eq for PrimitiveMeta
Source§impl PartialEq for PrimitiveMeta
impl PartialEq for PrimitiveMeta
impl StructuralPartialEq for PrimitiveMeta
Auto Trait Implementations§
impl Freeze for PrimitiveMeta
impl RefUnwindSafe for PrimitiveMeta
impl Send for PrimitiveMeta
impl Sync for PrimitiveMeta
impl Unpin for PrimitiveMeta
impl UnsafeUnpin for PrimitiveMeta
impl UnwindSafe for PrimitiveMeta
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