pub enum HookOutcome {
Allow,
Modify(Value),
Cancel(Option<String>),
Retry,
}Expand description
What a hook decided.
Deliberately not Option<Value>: “proceed unchanged” and “proceed with
this” are different answers, and so is “do not proceed”. Collapsing them
would make a cancelling hook indistinguishable from one that returned
nothing, which is the failure mode the taint gate’s own history warns about.
Variants§
Allow
Proceed unchanged.
Modify(Value)
Proceed, using this value instead. Its shape is the caller’s contract.
Cancel(Option<String>)
Do not proceed. The reason is shown to the operator and, where the caller can, written into the agent’s context so the model learns why.
Retry
Do the thing again. Not every caller can honour this; one that cannot
says so rather than silently treating it as Allow.
Trait Implementations§
Source§impl Clone for HookOutcome
impl Clone for HookOutcome
Source§fn clone(&self) -> HookOutcome
fn clone(&self) -> HookOutcome
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 HookOutcome
impl Debug for HookOutcome
Source§impl PartialEq for HookOutcome
impl PartialEq for HookOutcome
impl StructuralPartialEq for HookOutcome
Auto Trait Implementations§
impl Freeze for HookOutcome
impl RefUnwindSafe for HookOutcome
impl Send for HookOutcome
impl Sync for HookOutcome
impl Unpin for HookOutcome
impl UnsafeUnpin for HookOutcome
impl UnwindSafe for HookOutcome
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