pub enum BatchDecision {
Allowed(Vec<Decision>),
Denied {
index: usize,
denial: Denial,
},
}Expand description
The atomic outcome of evaluating checks in caller-supplied order.
An allowed batch contains one allowed decision for each input check, in the
same order. A denied batch reports the original input index that failed.
Backends must not consume any check when returning BatchDecision::Denied.
Variants§
Allowed(Vec<Decision>)
Every input check was allowed.
Denied
One input check caused the whole batch to be denied.
Implementations§
Source§impl BatchDecision
impl BatchDecision
Sourcepub fn try_into_single_decision(self) -> Result<Decision, Self>
pub fn try_into_single_decision(self) -> Result<Decision, Self>
Converts a batch-of-one outcome into its single-check decision.
Returns the original batch when an allowed result does not contain exactly one allowed decision or a denied result names an index other than zero.
§Errors
Returns the unchanged batch when it is not a valid batch-of-one result.
Trait Implementations§
Source§impl Clone for BatchDecision
impl Clone for BatchDecision
Source§fn clone(&self) -> BatchDecision
fn clone(&self) -> BatchDecision
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BatchDecision
impl Debug for BatchDecision
impl Eq for BatchDecision
Source§impl PartialEq for BatchDecision
impl PartialEq for BatchDecision
impl StructuralPartialEq for BatchDecision
Auto Trait Implementations§
impl Freeze for BatchDecision
impl RefUnwindSafe for BatchDecision
impl Send for BatchDecision
impl Sync for BatchDecision
impl Unpin for BatchDecision
impl UnsafeUnpin for BatchDecision
impl UnwindSafe for BatchDecision
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