pub struct Policy { /* private fields */ }Expand description
The complete policy one surface is lowered under: the evaluation family it belongs to, which owner facts map to which claims, and what each claim permits.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn declared(
family: Name,
mappings: Vec<FactMapping>,
permissions: Vec<Permission>,
) -> Result<Self, DeclarationError>
pub fn declared( family: Name, mappings: Vec<FactMapping>, permissions: Vec<Permission>, ) -> Result<Self, DeclarationError>
Declare the complete policy one surface is lowered under.
§Errors
Returns DeclarationError::Doubled where one owner fact is mapped twice or two permissions name one claim, and DeclarationError::Unbounded where either roster outgrows its declared magnitude.
Sourcepub fn mappings(&self) -> &[FactMapping]
pub fn mappings(&self) -> &[FactMapping]
The owner-fact mappings, in the order they were declared.
Sourcepub fn permissions(&self) -> &[Permission]
pub fn permissions(&self) -> &[Permission]
The permissions, in the order they were declared.
Trait Implementations§
impl Eq for Policy
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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