Skip to main content

CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler<C>:
    Send
    + Sync
    + 'static
where C: Command,
{ // Required method fn call(&self, context: CommandContext, args: C::Args) -> CommandFuture<C>; }

Required Methods§

Source

fn call(&self, context: CommandContext, args: C::Args) -> CommandFuture<C>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C, F, Fut> CommandHandler<C> for F
where C: Command, F: Fn(CommandContext, C::Args) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<C::Output, C::Error>> + Send + 'static,