Trait niri_ipc::state::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.

Implementors§