pub trait ToolState {
type ParamType: for<'a> Deserialize<'a> + Display + JsonSchema;
type ResultType: for<'a> Deserialize<'a> + Serialize + Display;
}Expand description
Connects a tool to its parameter and result types.
This exists so CallableTool is forced to use the correct types (when using the
tool! macro). It is separate from CallableTool because the macro
implements this, and the user implements the latter.
Required Associated Types§
Sourcetype ParamType: for<'a> Deserialize<'a> + Display + JsonSchema
type ParamType: for<'a> Deserialize<'a> + Display + JsonSchema
Associated parameter type.
Sourcetype ResultType: for<'a> Deserialize<'a> + Serialize + Display
type ResultType: for<'a> Deserialize<'a> + Serialize + Display
Associated return type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".