pub trait ErasedTool:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn schema(&self) -> Schema;
fn erased_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx_request: &'life1 ContextRequest,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn erased_is_available<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx_request: &'life1 ContextRequest,
_compiled_context: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Type-erased trait for tools registered dynamically at runtime.
Required Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Human/LLM-readable description explaining the tool’s capability.
Sourcefn erased_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx_request: &'life1 ContextRequest,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erased_execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx_request: &'life1 ContextRequest,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes the tool with untyped JSON arguments and returns structured JSON output.
Provided Methods§
Sourcefn erased_is_available<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx_request: &'life1 ContextRequest,
_compiled_context: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn erased_is_available<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_ctx_request: &'life1 ContextRequest,
_compiled_context: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluated per turn to determine if tool is currently active/available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".