StateCoordinator

Trait StateCoordinator 

Source
pub trait StateCoordinator {
    // Required methods
    fn process_event(&self, event: &StateEvent) -> StateChange;
    fn apply_change(&mut self, change: StateChange);
    fn emit_event(&self, event: StateEvent);
}
Expand description

Trait for coordinating state changes

Required Methods§

Source

fn process_event(&self, event: &StateEvent) -> StateChange

Process a state event and return changes to apply

Source

fn apply_change(&mut self, change: StateChange)

Apply a state change to the buffer

Source

fn emit_event(&self, event: StateEvent)

Emit an event (for notification)

Implementors§