pub struct ToolMeta {
pub name: &'static str,
pub description: &'static str,
pub call: fn(Arc<ToolContext>, Value) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send>>,
pub schema: fn() -> &'static Value,
pub examples: fn() -> &'static [(&'static str, &'static str)],
}Expand description
Tool metadata (type-erased)
This struct is submitted to inventory by the #[tool] macro.
Fields§
§name: &'static strTool name
description: &'static strTool description
call: fn(Arc<ToolContext>, Value) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send>>Type-erased call function
Takes Arc<ToolContext> and JSON value, returns future.
schema: fn() -> &'static ValueSchema generator function (returns JSON Value for flexibility)
examples: fn() -> &'static [(&'static str, &'static str)]Examples accessor function
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolMeta
impl RefUnwindSafe for ToolMeta
impl Send for ToolMeta
impl Sync for ToolMeta
impl Unpin for ToolMeta
impl UnsafeUnpin for ToolMeta
impl UnwindSafe for ToolMeta
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