pub trait Handler<T>:
Clone
+ Send
+ Sync
+ Sized
+ 'static {
const BACKGROUND_TASKS: bool = false;
// Required methods
fn call(self, req: Request) -> impl Future<Output = Response> + Send;
fn describe(op: &mut Operation, registry: &mut SchemaRegistry);
}Expand description
An endpoint callable with a request. T is an inference marker.
Provided Associated Constants§
Sourceconst BACKGROUND_TASKS: bool = false
const BACKGROUND_TASKS: bool = false
Whether this handler needs request-owned background work.
Required Methods§
Sourcefn call(self, req: Request) -> impl Future<Output = Response> + Send
fn call(self, req: Request) -> impl Future<Output = Response> + Send
Run extraction, the handler body and response conversion.
Sourcefn describe(op: &mut Operation, registry: &mut SchemaRegistry)
fn describe(op: &mut Operation, registry: &mut SchemaRegistry)
Document the operation implied by the handler’s signature.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".