Skip to main content

AllOfVeto

Struct AllOfVeto 

Source
pub struct AllOfVeto<D: PolicyDomain> { /* private fields */ }
Expand description

Forbids when all veto children forbid.

Implementations§

Source§

impl<D: PolicyDomain> AllOfVeto<D>

Source

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>

Source

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>

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,

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,

Returns one result per input, in the same order.
Source§

fn policy_type(&self) -> Cow<'static, str>

Name for audit trees and telemetry.
Source§

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>
where Vec<Arc<dyn VetoPolicy<D>>>: Freeze,

§

impl<D> Send for AllOfVeto<D>
where Vec<Arc<dyn VetoPolicy<D>>>: Send,

§

impl<D> Sync for AllOfVeto<D>
where Vec<Arc<dyn VetoPolicy<D>>>: Sync,

§

impl<D> Unpin for AllOfVeto<D>
where Vec<Arc<dyn VetoPolicy<D>>>: Unpin,

§

impl<D> UnsafeUnpin for AllOfVeto<D>
where Vec<Arc<dyn VetoPolicy<D>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<D, P> VetoPolicyExt<D> for P
where D: PolicyDomain, P: VetoPolicy<D> + 'static,

Source§

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>

Forbids if either child forbids. A definite veto defeats uncertainty.
Source§

fn boxed(self) -> Box<dyn VetoPolicy<D>>

Boxes the veto policy.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more