Struct scratchstack_aspen::PolicySet
source · [−]pub struct PolicySet { /* private fields */ }
Implementations
sourceimpl PolicySet
impl PolicySet
pub fn new() -> Self
pub fn add_policy(&mut self, source: PolicySource, policy: Policy)
pub fn policies(&self) -> &Vec<(PolicySource, Policy)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
sourcepub fn evaluate<'a, 'b>(
&'a self,
context: &'b Context
) -> Result<(Decision, Vec<&'a PolicySource>), AspenError>
pub fn evaluate<'a, 'b>(
&'a self,
context: &'b Context
) -> Result<(Decision, Vec<&'a PolicySource>), AspenError>
Evaluate the policy set. If a denial is found, return a Deny and the source immediately. Otherwise, if one or more approvals are found, return Allow and the relevant sources. Otherwise, return a DefaultDeny with no sources.
pub fn evaluate_all<'a, 'b>(
&'a self,
context: &'b Context
) -> Result<(Decision, Vec<&'a PolicySource>), AspenError>
Trait Implementations
sourceimpl From<Vec<(PolicySource, Policy), Global>> for PolicySet
impl From<Vec<(PolicySource, Policy), Global>> for PolicySet
sourcefn from(policies: Vec<(PolicySource, Policy)>) -> Self
fn from(policies: Vec<(PolicySource, Policy)>) -> Self
Converts to this type from the input type.
impl Eq for PolicySet
impl StructuralEq for PolicySet
impl StructuralPartialEq for PolicySet
Auto Trait Implementations
impl RefUnwindSafe for PolicySet
impl Send for PolicySet
impl Sync for PolicySet
impl Unpin for PolicySet
impl UnwindSafe for PolicySet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more