CommandHandler

Type Alias CommandHandler 

Source
pub type CommandHandler = Box<dyn Fn(Value, RpcContext) -> Pin<Box<dyn Future<Output = Result<Option<Value>, String>> + Send>> + Send + Sync>;
Expand description

A boxed async handler function. Takes the command data and returns either:

  • Ok(Some(value)) for a single response
  • Ok(None) for no response
  • Err(msg) for an error response

Aliased Typeยง

pub struct CommandHandler(/* private fields */);