pub struct VerbRouter { /* private fields */ }Expand description
Presents an agent’s screen action to the person (spec 3.3 §7.1): the policy’s words as the summary (“Move News digest to 19:00”), the risk its effect carries (a change on the person’s own screens is low) and Allow once · Edit · Deny. Every other call goes to the fallback router unchanged.
§Example
use adk_core::{ApprovalPolicy, ApproverSelector, InMemoryApprovalStore, StoreApprovalService};
use std::sync::Arc;
let operator = ApprovalPolicy::new([ApproverSelector::group("operator")]).allow_self_approval();
let service = StoreApprovalService::new(Arc::new(InMemoryApprovalStore::new()))
.with_router(registry.router(operator));Implementations§
Source§impl VerbRouter
impl VerbRouter
Sourcepub fn catalogue(app: &str, fallback: impl ApprovalRouter + 'static) -> Self
pub fn catalogue(app: &str, fallback: impl ApprovalRouter + 'static) -> Self
The router of the first catalogue’s tools in app, with fallback for every other
call, for a host that builds its approval service before the registry, which reads
that service’s store (spec 3.3 §2 item 7).
§Example
use adk_core::{ApprovalPolicy, ApproverSelector};
use adk_surface::verbs::VerbRouter;
let operator = ApprovalPolicy::new([ApproverSelector::group("operator")]);
let router = VerbRouter::catalogue("adk-rust", operator);Trait Implementations§
Source§impl ApprovalRouter for VerbRouter
impl ApprovalRouter for VerbRouter
Source§fn route(&self, call: &ApprovalCall) -> Option<ApprovalRoute>
fn route(&self, call: &ApprovalCall) -> Option<ApprovalRoute>
The route for
call, or None to leave it held in the store only.Source§impl Clone for VerbRouter
impl Clone for VerbRouter
Auto Trait Implementations§
impl !RefUnwindSafe for VerbRouter
impl !UnwindSafe for VerbRouter
impl Forget for VerbRouter
impl Freeze for VerbRouterwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, EffectClass> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, EffectClass)>>: Freeze,
*const ArcInner<dyn ApprovalRouter> is !null: Freeze,
PhantomData<ArcInner<dyn ApprovalRouter>>: Freeze,
impl Move for VerbRouter
impl Send for VerbRouterwhere
RawVecInner: Send,
NodeRef<Owned, String, EffectClass, LeafOrInternal>: Send,
BoxRaw<(String, EffectClass)>: Send,
Arc<dyn ApprovalRouter>: Send,
impl Sync for VerbRouterwhere
RawVecInner: Sync,
NodeRef<Owned, String, EffectClass, LeafOrInternal>: Sync,
BoxRaw<(String, EffectClass)>: Sync,
Arc<dyn ApprovalRouter>: Sync,
impl Unpin for VerbRouterwhere
*const u8 is !null: Unpin,
*const LeafNode<String, EffectClass> is !null: Unpin,
Box<(String, EffectClass)>: Unpin,
Arc<dyn ApprovalRouter>: Unpin,
impl UnsafeUnpin for VerbRouterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, EffectClass> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, EffectClass)>>: UnsafeUnpin,
*const ArcInner<dyn ApprovalRouter> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ApprovalRouter>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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