pub trait ToolHandler<Marker>:
Clone
+ Send
+ Sync
+ 'static {
// Required method
fn into_handler_fn(self) -> ToolHandlerFn;
}Expand description
Implemented for async functions that can serve as tool handlers.
Supports two calling conventions:
|args: serde_json::Value| async { ... }– raw JSON args|params: MyStruct| async { ... }– typed, deserialized args
Required Methods§
fn into_handler_fn(self) -> ToolHandlerFn
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<F, Fut, R, T> ToolHandler<AuthenticatedMarker<T>> for F
Available on crate feature
auth only.