pub struct Registry { /* private fields */ }Expand description
The shared tool registry consumed by both front ends.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn register(&mut self, spec: ToolSpec)
pub fn register(&mut self, spec: ToolSpec)
Register a tool. Panics on a duplicate name — a programming error, caught in tests, never reachable from user input.
Sourcepub fn call(
&self,
name: &str,
ctx: &Ctx,
args: &Value,
) -> Result<ToolOutcome, EngineFault>
pub fn call( &self, name: &str, ctx: &Ctx, args: &Value, ) -> Result<ToolOutcome, EngineFault>
Dispatch a call. An unknown tool, a missing required argument, or a
transport failure mid-request is an EngineFault (Err); a business
failure is Ok(ToolOutcome { tool_error: Some(..) }).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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
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