Projection

Trait Projection 

Source
pub trait Projection: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn process(&self, event: &Event) -> Result<()>;
    fn get_state(&self, entity_id: &str) -> Option<Value>;
    fn clear(&self);
}
Expand description

A projection aggregates events into a queryable view

Required Methods§

Source

fn name(&self) -> &str

Get the name of this projection

Source

fn process(&self, event: &Event) -> Result<()>

Process an event and update the projection state

Source

fn get_state(&self, entity_id: &str) -> Option<Value>

Get the current state of the projection for an entity

Source

fn clear(&self)

Clear all projection state

Implementors§