Skip to main content

CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler<C>: Send + Sync
where C: Command,
{ // Required method fn handle(&self, command: &C) -> Result<(), MessengerError>; }
Expand description

Handles one command type. Register at most one per crate::Message::NAME.

Required Methods§

Source

fn handle(&self, command: &C) -> Result<(), MessengerError>

Handles command.

§Errors

Return MessengerError when handling fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§