pub enum Decision {
Allow,
Deny(String),
Defer,
}Expand description
The gate’s answer to one call.
Variants§
Allow
Deny(String)
Declined, with the reason the model reads as the tool result. A denial is information: “the user declined” without a why teaches the model nothing.
Defer
Not answered yet. The loop stops rather than deciding on the user’s behalf.
Implementations§
Source§impl Decision
impl Decision
Sourcepub fn store(&self) -> Option<String>
pub fn store(&self) -> Option<String>
How this answer is stored. Defer has no row value: a call with no decision is deferred,
and storing “deferred” would make “waiting” look like an answer that had arrived.
Sourcepub fn parse(stored: &str) -> Self
pub fn parse(stored: &str) -> Self
The inverse of store, for a row that has a decision column set.
Fails closed (#427). This used to read anything without a deny: prefix as Allow, so a
row this build did not write — an older scheme, a higher version’s word, a hand-edited
state.db — became an approval for a call nobody approved. An unknown answer is a denial
that says what it did not understand; the only way to allow is to say allow.
Trait Implementations§
impl Eq for Decision
impl StructuralPartialEq for Decision
Auto Trait Implementations§
impl Forget for Decision
impl Freeze for Decision
impl Move for Decision
impl RefUnwindSafe for Decision
impl Send for Decisionwhere
RawVecInner: Send,
impl Sync for Decisionwhere
RawVecInner: Sync,
impl Unpin for Decision
impl UnsafeUnpin for Decision
impl UnwindSafe for Decisionwhere
RawVecInner: UnwindSafe,
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§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.