#[non_exhaustive]pub enum PolicyOutcome {
Allowed {
decision: PolicyDecision,
},
NeedsConfirmation {
decision: PolicyDecision,
interaction: Box<InteractionSpec>,
},
Blocked {
decision: PolicyDecision,
reason: BlockReason,
},
}Expand description
What the engine decided about one command.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Allowed
The command may execute with the origin it carries.
Fields
§
decision: PolicyDecisionThe recorded decision.
NeedsConfirmation
The command needs a specific confirmation first; here is the card.
The card is boxed because it is by far the largest thing an outcome can carry and most outcomes are not this one.
Fields
§
decision: PolicyDecisionThe recorded decision.
§
interaction: Box<InteractionSpec>The card to persist before anything executes.
Blocked
The command may not execute, and no card the user can click changes that.
Implementations§
Source§impl PolicyOutcome
impl PolicyOutcome
Sourcepub fn decision(&self) -> &PolicyDecision
pub fn decision(&self) -> &PolicyDecision
The decision, whatever the outcome.
Sourcepub fn into_decision(self) -> PolicyDecision
pub fn into_decision(self) -> PolicyDecision
Consumes the outcome and returns the decision.
Sourcepub fn interaction(&self) -> Option<&InteractionSpec>
pub fn interaction(&self) -> Option<&InteractionSpec>
The card the outcome requires, when there is one.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Returns true for Self::Allowed.
Trait Implementations§
Source§impl Clone for PolicyOutcome
impl Clone for PolicyOutcome
Source§impl Debug for PolicyOutcome
impl Debug for PolicyOutcome
impl Eq for PolicyOutcome
Source§impl PartialEq for PolicyOutcome
impl PartialEq for PolicyOutcome
impl StructuralPartialEq for PolicyOutcome
Auto Trait Implementations§
impl Freeze for PolicyOutcome
impl RefUnwindSafe for PolicyOutcome
impl Send for PolicyOutcome
impl Sync for PolicyOutcome
impl Unpin for PolicyOutcome
impl UnsafeUnpin for PolicyOutcome
impl UnwindSafe for PolicyOutcome
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.