Command

Trait Command 

Source
pub trait Command<E>
where Self: Debug + Send + 'static, E: EventSourced,
{ type Reply: Send + Sync + 'static; type Error: Send + 'static; // Required method fn handle_command( self, id: &E::Id, state: &E, ) -> CommandEffect<E, Self::Reply, Self::Error>; }
Expand description

A command for a EventSourced implementation, defining command handling and replying.

Required Associated Types§

Source

type Reply: Send + Sync + 'static

The type for replies.

Source

type Error: Send + 'static

The type for rejecting this command.

Required Methods§

Source

fn handle_command( self, id: &E::Id, state: &E, ) -> CommandEffect<E, Self::Reply, Self::Error>

The command handler, taking this command, and references to the ID and the state of the event sourced entity, either rejecting this command via CommandEffect::reject or returning an event using CommandEffect::emit_and_reply (or CommandEffect::emit in case Reply = ()).

Implementors§