Expand description
The Command trait and the DynCommand helper.
A Command pairs a string identifier with a typed request/response
pair and an async handler. For compile-time commands, the
#[command] attribute macro generates the trait impl; for
runtime-constructed commands (plugin runtimes, FFI, scripting
hosts), DynCommand lets you build a Command instance whose
id / description / schema are owned at runtime.
Structs§
- DynCommand
- A runtime-constructed
Command. Use this when the command id or schema is only known at runtime (plugin runtimes, FFI, scripting hosts).
Traits§
- Command
- A typed command handler registered with a
CommandRegistry.
Type Aliases§
- Boxed
DynCommand - A
DynCommandwith fully erased handler types — request and response areserde_json::Value, the handler is a boxed async closure. Use when you need to store a heterogeneous collection of runtime commands (e.g.Vec<BoxedDynCommand>inside a plugin host). - Boxed
Handler - Type-erased async handler for a
BoxedDynCommand: takes and returns raw JSONValues.