pub struct PolicyRegistry { /* private fields */ }Expand description
Registry for security policies defined in ## Policy blocks.
Implementations§
Source§impl PolicyRegistry
impl PolicyRegistry
pub fn new() -> Self
Sourcepub fn register_predicate(&mut self, def: PredicateDef)
pub fn register_predicate(&mut self, def: PredicateDef)
Register a predicate definition
Sourcepub fn register_capability(&mut self, def: CapabilityDef)
pub fn register_capability(&mut self, def: CapabilityDef)
Register a capability definition
Sourcepub fn get_predicates(&self, subject_type: Symbol) -> Option<&[PredicateDef]>
pub fn get_predicates(&self, subject_type: Symbol) -> Option<&[PredicateDef]>
Get predicates for a type
Sourcepub fn get_capabilities(&self, subject_type: Symbol) -> Option<&[CapabilityDef]>
pub fn get_capabilities(&self, subject_type: Symbol) -> Option<&[CapabilityDef]>
Get capabilities for a type
Sourcepub fn has_predicates(&self, subject_type: Symbol) -> bool
pub fn has_predicates(&self, subject_type: Symbol) -> bool
Check if a type has any predicates
Sourcepub fn has_capabilities(&self, subject_type: Symbol) -> bool
pub fn has_capabilities(&self, subject_type: Symbol) -> bool
Check if a type has any capabilities
Sourcepub fn iter_predicates(
&self,
) -> impl Iterator<Item = (&Symbol, &Vec<PredicateDef>)>
pub fn iter_predicates( &self, ) -> impl Iterator<Item = (&Symbol, &Vec<PredicateDef>)>
Iterate over all types with predicates (for codegen)
Sourcepub fn iter_capabilities(
&self,
) -> impl Iterator<Item = (&Symbol, &Vec<CapabilityDef>)>
pub fn iter_capabilities( &self, ) -> impl Iterator<Item = (&Symbol, &Vec<CapabilityDef>)>
Iterate over all types with capabilities (for codegen)
Trait Implementations§
Source§impl Clone for PolicyRegistry
impl Clone for PolicyRegistry
Source§fn clone(&self) -> PolicyRegistry
fn clone(&self) -> PolicyRegistry
Returns a duplicate of the value. Read more
1.0.0 · 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 PolicyRegistry
impl Debug for PolicyRegistry
Source§impl Default for PolicyRegistry
impl Default for PolicyRegistry
Source§fn default() -> PolicyRegistry
fn default() -> PolicyRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PolicyRegistry
impl RefUnwindSafe for PolicyRegistry
impl Send for PolicyRegistry
impl Sync for PolicyRegistry
impl Unpin for PolicyRegistry
impl UnwindSafe for PolicyRegistry
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