pub struct AllOfVeto<D: PolicyDomain> { /* private fields */ }Expand description
Forbids when all veto children forbid.
Implementations§
Source§impl<D: PolicyDomain> AllOfVeto<D>
impl<D: PolicyDomain> AllOfVeto<D>
Sourcepub fn try_new(
policies: Vec<Arc<dyn VetoPolicy<D>>>,
) -> Result<Self, EmptyPoliciesError>
pub fn try_new( policies: Vec<Arc<dyn VetoPolicy<D>>>, ) -> Result<Self, EmptyPoliciesError>
Builds a combinator from a nonempty list.
Source§impl<D: PolicyDomain> AllOfVeto<D>
impl<D: PolicyDomain> AllOfVeto<D>
Sourcepub fn named(self, name: impl Into<Cow<'static, str>>) -> Self
pub fn named(self, name: impl Into<Cow<'static, str>>) -> Self
Replaces this combinator’s default type name (for example
"AllOfVeto")
in its audit-tree node, attribution paths, and telemetry, so
two combinators of the same type can be told apart.
An all-of veto forbids only when every child does, so this is the name crate::AccessEvaluation::forbidden_by reports; name it after the rule it expresses.
Unlike crate::PermissionChecker::named, which only labels a
checker’s telemetry, this name is the policy’s audit identity.
Trait Implementations§
Source§impl<D: PolicyDomain> VetoPolicy<D> for AllOfVeto<D>
impl<D: PolicyDomain> VetoPolicy<D> for AllOfVeto<D>
Source§fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 EvalCtx<'life2, D>,
) -> Pin<Box<dyn Future<Output = VetoResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 EvalCtx<'life2, D>,
) -> Pin<Box<dyn Future<Output = VetoResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluates the veto for one resource.
Source§fn evaluate_batch<'item, 'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 BatchEvalCtx<'item, D>,
) -> Pin<Box<dyn Future<Output = Vec<VetoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'item: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evaluate_batch<'item, 'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 BatchEvalCtx<'item, D>,
) -> Pin<Box<dyn Future<Output = Vec<VetoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'item: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns one result per input, in the same order.
Source§fn policy_type(&self) -> Cow<'static, str>
fn policy_type(&self) -> Cow<'static, str>
Name for audit trees and telemetry.
Source§fn security_rule(&self) -> SecurityRuleMetadata
fn security_rule(&self) -> SecurityRuleMetadata
Security-rule metadata.
Auto Trait Implementations§
impl<D> !RefUnwindSafe for AllOfVeto<D>
impl<D> !UnwindSafe for AllOfVeto<D>
impl<D> Freeze for AllOfVeto<D>
impl<D> Send for AllOfVeto<D>
impl<D> Sync for AllOfVeto<D>
impl<D> Unpin for AllOfVeto<D>
impl<D> UnsafeUnpin for AllOfVeto<D>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<D, P> VetoPolicyExt<D> for Pwhere
D: PolicyDomain,
P: VetoPolicy<D> + 'static,
impl<D, P> VetoPolicyExt<D> for Pwhere
D: PolicyDomain,
P: VetoPolicy<D> + 'static,
Source§fn all_of<P: VetoPolicy<D> + 'static>(self, other: P) -> AllOfVeto<D>
fn all_of<P: VetoPolicy<D> + 'static>(self, other: P) -> AllOfVeto<D>
Forbids only if both children forbid. A definite pass defeats uncertainty.
Source§fn any_of<P: VetoPolicy<D> + 'static>(self, other: P) -> AnyOfVeto<D>
fn any_of<P: VetoPolicy<D> + 'static>(self, other: P) -> AnyOfVeto<D>
Forbids if either child forbids. A definite veto defeats uncertainty.
Source§fn boxed(self) -> Box<dyn VetoPolicy<D>>
fn boxed(self) -> Box<dyn VetoPolicy<D>>
Boxes the veto policy.