pub trait ExtractorHandler<S, T>:
Clone
+ Send
+ Sync
+ 'static {
type Future: Future<Output = Result<CallToolResult>> + Send;
// Required methods
fn call(self, ctx: RequestContext, state: S, args: Value) -> Self::Future;
fn input_schema() -> Value;
}Expand description
A handler that uses extractors.
This trait is implemented for functions that take extractors as arguments. You don’t need to implement this trait directly; it’s automatically implemented for compatible async functions.
Required Associated Types§
Required Methods§
Sourcefn call(self, ctx: RequestContext, state: S, args: Value) -> Self::Future
fn call(self, ctx: RequestContext, state: S, args: Value) -> Self::Future
Call the handler with extracted values.
Sourcefn input_schema() -> Value
fn input_schema() -> Value
Get the input schema for this handler.
Returns None if no Json<T> extractor is used.
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.