pub struct PolicyRequest<'a> {
pub command_ref: CommandRef,
pub interaction_key: String,
pub case_ref: &'a CaseRef,
pub policy: Option<&'a CommandPolicy>,
pub origin: &'a CommandOrigin,
pub command: &'a Value,
}Expand description
One command as the policy engine sees it.
It carries no domain knowledge on purpose: everything the engine needs to
apply a constraint is already in the CommandPolicy, so a domain cannot
accidentally exempt itself from “do not submit” by forgetting a flag.
Fields§
§command_ref: CommandRefWhich command the decision is about.
interaction_key: StringStable key for the card the decision may require (e.g.
"confirm:acts[0]"). Two requests with the same key describe one card.
case_ref: &'a CaseRefThe case the command runs on, and the revision a card would bind to.
policy: Option<&'a CommandPolicy>The domain’s policy. None means “unclassified”, treated as
CommandPolicy::conservative.
origin: &'a CommandOriginThe origin the command would carry.
command: &'a ValueThe erased command, handed to the review diff builder.
Implementations§
Source§impl PolicyRequest<'_>
impl PolicyRequest<'_>
Sourcepub fn effective_policy(&self) -> CommandPolicy
pub fn effective_policy(&self) -> CommandPolicy
The policy actually applied: the domain’s, or the conservative one.
Trait Implementations§
Source§impl<'a> Clone for PolicyRequest<'a>
impl<'a> Clone for PolicyRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for PolicyRequest<'a>
impl<'a> RefUnwindSafe for PolicyRequest<'a>
impl<'a> Send for PolicyRequest<'a>
impl<'a> Sync for PolicyRequest<'a>
impl<'a> Unpin for PolicyRequest<'a>
impl<'a> UnsafeUnpin for PolicyRequest<'a>
impl<'a> UnwindSafe for PolicyRequest<'a>
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