#[non_exhaustive]pub enum EffectGate {
Always,
DestructiveOnly,
MutatingAndAbove,
}Expand description
Selector for which tool dispatches the ApprovalLayer gates
through the Approver. Routes by the calling tool’s
ToolMetadata::effect so
operators express intent once at metadata time and the layer
honours it without per-tool wiring.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Always
Every dispatch reaches the approver — the original behaviour (and the safe default for deployments where every tool call must have an explicit go-ahead).
DestructiveOnly
Only ToolEffect::Destructive tools reach the approver.
ReadOnly and Mutating calls auto-approve. The narrowest
gate that still requires confirmation for irreversible
operations — typical “agent has free rein except for the
dangerous handful” deployments.
MutatingAndAbove
Both ToolEffect::Mutating and ToolEffect::Destructive
reach the approver. ReadOnly calls auto-approve.
Appropriate when even reversible writes need a human in the
loop (regulated workloads, compliance-bound flows).
Implementations§
Source§impl EffectGate
impl EffectGate
Sourcepub const fn requires_approval(self, effect: ToolEffect) -> bool
pub const fn requires_approval(self, effect: ToolEffect) -> bool
Whether a tool with the given effect should be gated by the approver under this policy.
Trait Implementations§
Source§impl Clone for EffectGate
impl Clone for EffectGate
Source§fn clone(&self) -> EffectGate
fn clone(&self) -> EffectGate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectGate
impl Debug for EffectGate
Source§impl Default for EffectGate
impl Default for EffectGate
Source§fn default() -> EffectGate
fn default() -> EffectGate
Source§impl PartialEq for EffectGate
impl PartialEq for EffectGate
Source§fn eq(&self, other: &EffectGate) -> bool
fn eq(&self, other: &EffectGate) -> bool
self and other values to be equal, and is used by ==.impl Eq for EffectGate
impl StructuralPartialEq for EffectGate
Auto Trait Implementations§
impl Freeze for EffectGate
impl RefUnwindSafe for EffectGate
impl Send for EffectGate
impl Sync for EffectGate
impl Unpin for EffectGate
impl UnsafeUnpin for EffectGate
impl UnwindSafe for EffectGate
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
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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