pub trait EventSourced {
    type Id: Debug + Clone + Send;
    type Evt: Debug + Send + Sync + 'static;

    const TYPE_NAME: &'static str;

    // Required method
    fn handle_evt(self, evt: Self::Evt) -> Self;
}
Expand description

The state of an event sourced entity as well as its event handling (which transforms the state).

Required Associated Types§

source

type Id: Debug + Clone + Send

The Id type.

source

type Evt: Debug + Send + Sync + 'static

The event type.

Required Associated Constants§

source

const TYPE_NAME: &'static str

The type name.

Required Methods§

source

fn handle_evt(self, evt: Self::Evt) -> Self

The event handler.

Object Safety§

This trait is not object safe.

Implementors§