Skip to main content

EventStreamStatePart

Trait EventStreamStatePart 

Source
pub trait EventStreamStatePart {
    // Required methods
    fn replicate(&self) -> Vec<Event>;
    fn apply(&mut self, event: Event) -> Option<Event>;
}
Expand description

Part of the state communicated via the event stream.

Required Methods§

Source

fn replicate(&self) -> Vec<Event>

Returns a sequence of events that replicates this state from default initialization.

Source

fn apply(&mut self, event: Event) -> Option<Event>

Applies the event to this state.

Returns None after applying the event, and Some(event) if the event is ignored by this part of the state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§