pub struct Judge<'a> { /* private fields */ }Expand description
The gate’s judge: one aux call per call that would otherwise be a card.
Wraps the person’s own approver, so every doubt lands there. It is installed by
crate::runtime::Agent for the duration of one run — smart is a mode of the run, not a
property of whoever built the gate — and counts its own failures for that run.
Implementations§
Trait Implementations§
Source§impl Approver for Judge<'_>
impl Approver for Judge<'_>
fn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 Pending,
) -> Pin<Box<dyn Future<Output = Decision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn approve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
summary: &'life2 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn approve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
summary: &'life2 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The yes/no form, for callers that have no third answer to give. A
Defer reads as “not
approved”, which is the fail-closed direction — but a caller that means to pause a run has
to implement decide itself, because this loses the distinction.Auto Trait Implementations§
impl<'a> !Freeze for Judge<'a>
impl<'a> !RefUnwindSafe for Judge<'a>
impl<'a> !UnwindSafe for Judge<'a>
impl<'a> Forget for Judge<'a>
impl<'a> Move for Judge<'a>
impl<'a> Send for Judge<'a>
impl<'a> Sync for Judge<'a>
impl<'a> Unpin for Judge<'a>
impl<'a> UnsafeUnpin for Judge<'a>where
&'a Arc<dyn ChatProvider>: UnsafeUnpin,
&'a str: UnsafeUnpin,
&'a dyn Approver: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const ArcInner<dyn Fn(&Pending, &Decision, Option<&str>) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&Pending, &Decision, Option<&str>) + Sync + Send>>: UnsafeUnpin,
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