pub enum ChainResult {
Allow,
ModifiedAllow(MemoryDelta),
Deny {
reason: String,
code: i32,
},
AskUser {
queued: Vec<AskUserPrompt>,
},
}Expand description
What the chain runner reports back to the dispatcher. Mirrors
HookDecision’s shape but at chain granularity:
ChainResult::Allow— every hook in the chain returnedAllow(or the chain was empty).ChainResult::ModifiedAllow— at least one hook returnedModify; the final merged delta is reported.ChainResult::Deny— a hook returnedDeny(or a hook errored underFailMode::Closed); the chain short-circuited.ChainResult::AskUser— the chain finished with at least one queued operator prompt and no clear Allow / Modify win.
Modify is not a chain-level outcome on its own — every chain
either also finishes Allow (ModifiedAllow) or short-circuits
on Deny. The dispatcher applies the cumulative delta exactly
once when the chain returns ModifiedAllow.
#969 — PartialEq is now derive-able because MemoryDelta
derives PartialEq (see hooks/events.rs). Pre-#969 we
hand-rolled equality routed through serde_json::to_value(...)
on the (mistaken) premise that serde_json::Value was not
PartialEq — it IS. MemoryDelta’s Option<f64> blocks
derive(Eq) (f64 has only PartialEq) but not
derive(PartialEq). The historical wrap-and-compare is gone.
Variants§
Trait Implementations§
Source§impl Clone for ChainResult
impl Clone for ChainResult
Source§fn clone(&self) -> ChainResult
fn clone(&self) -> ChainResult
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 ChainResult
impl Debug for ChainResult
Source§impl PartialEq for ChainResult
impl PartialEq for ChainResult
Source§fn eq(&self, other: &ChainResult) -> bool
fn eq(&self, other: &ChainResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ChainResult
Auto Trait Implementations§
impl Freeze for ChainResult
impl RefUnwindSafe for ChainResult
impl Send for ChainResult
impl Sync for ChainResult
impl Unpin for ChainResult
impl UnsafeUnpin for ChainResult
impl UnwindSafe for ChainResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more