pub struct VerbGate { /* private fields */ }Expand description
A person’s screen actions, from any surface that may take them (spec 3.3 §2 item 7, §7.2).
call runs one for an authenticated Caller:
- Where (§7.2): the home, the phone, a terminal and voice take screen actions; a chat channel and the tray do not, and an agent asks through its own tool.
- Whose (S-I8): only the caller’s own items, in any area.
- The governed path:
authorize_tool_callunderurn:adk:agent:<app>/surface.verbs, acting for the person, so the call has atool_callrecord like any other. Stop all applies, except to an action that only delays work, such as snooze (owner question 23). - The record:
surface.verb, through the engine’s record, stamped with the surface, how it was given, the device and presence; for voice, the transcript’s digest, never the words.
What it did is answered only after it ran.
§Example
use adk_surface::verbs::{ObjectRef, VerbGate, VerbIntent};
use adk_surface::{Caller, Origin, SurfaceKind};
let ana = Caller::human("ana", SurfaceKind::Web, Origin::Pointer);
let item = gate.coming_up(&ana).await?.remove(0);
let snooze = VerbIntent::new("snooze", serde_json::json!({ "to": item.choices[0].to }))
.on(ObjectRef::coming_up(&item.id));
let done = gate.call(&ana, snooze).await?;
println!("{}", done.text);Implementations§
Source§impl VerbGate
impl VerbGate
Sourcepub fn new(registry: VerbRegistry, engine: SurfaceEngine) -> Self
pub fn new(registry: VerbRegistry, engine: SurfaceEngine) -> Self
A person’s actions of registry, recorded through engine.
Sourcepub fn registry(&self) -> &VerbRegistry
pub fn registry(&self) -> &VerbRegistry
The registry.
Sourcepub fn engine(&self) -> &SurfaceEngine
pub fn engine(&self) -> &SurfaceEngine
The engine the actions are recorded through.
Sourcepub fn voice_cancel_window(&self) -> Duration
pub fn voice_cancel_window(&self) -> Duration
How long a spoken action waits before it runs, and can be cancelled: the engine’s window for a spoken “allow once” (spec 3.3 §5.6, owner question 26).
Sourcepub async fn coming_up(
&self,
caller: &Caller,
) -> Result<Vec<ComingUpItem>, VerbError>
pub async fn coming_up( &self, caller: &Caller, ) -> Result<Vec<ComingUpItem>, VerbError>
The caller’s Coming up, with the times each item may move to.
§Errors
VerbError::NotHere from a chat channel, the tray or an agent; the kernel’s error.
Sourcepub async fn call(
&self,
caller: &Caller,
intent: VerbIntent,
) -> Result<VerbDone, VerbError>
pub async fn call( &self, caller: &Caller, intent: VerbIntent, ) -> Result<VerbDone, VerbError>
Takes the action intent names, for caller (spec 3.3 §2 item 7).
§Errors
| Error | When |
|---|---|
VerbError::NotHere | From a chat channel, the tray, or an agent |
VerbError::Unknown | No such action |
VerbError::Invalid | An object kind the action does not take, or its arguments are wrong |
VerbError::NotFound | No such item of the caller’s |
VerbError::Refused | It cannot be done now, or the governed path refused it — Stop all for an action that does not only delay |
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for VerbGate
impl !UnwindSafe for VerbGate
impl Forget for VerbGate
impl Freeze for VerbGatewhere
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
impl Move for VerbGate
impl Send for VerbGate
impl Sync for VerbGate
impl Unpin for VerbGate
impl UnsafeUnpin for VerbGatewhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: 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