Trait Event

Source
pub trait Event<S> {
    // Required method
    fn evolve(&self, state: &mut S);
}
Expand description

An event that encodes a change to a layer’s state

Required Methods§

Source

fn evolve(&self, state: &mut S)

Evolve the provided state

This is the only method that Layer gives mutable access to the state, making sure that all changes to the state are captured as events.

Implementations of this method are supposed to be relatively dumb. Any decisions that go into updating the state should be made in Command::decide, and encoded into the event.

Implementors§