Trait eventsourced::Cmd
source · pub trait Cmd<E>{
type Reply: Send + 'static;
type Error: Send + 'static;
// Required method
fn handle_cmd(
self,
id: &E::Id,
state: &E
) -> CmdEffect<E, Self::Reply, Self::Error>;
}Expand description
A command for a EventSourced implementation, defining command handling and replying.
Required Associated Types§
Required Methods§
sourcefn handle_cmd(
self,
id: &E::Id,
state: &E
) -> CmdEffect<E, Self::Reply, Self::Error>
fn handle_cmd( self, id: &E::Id, state: &E ) -> CmdEffect<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 CmdEffect::reject or returning
an event using CmdEffect::emit_and_reply (or CmdEffect::emit in case Reply = ()).