Trait cqrs_es::View

source ·
pub trait View<A: Aggregate>: Debug + Default + Serialize + DeserializeOwned + Send + Sync {
    // Required method
    fn update(&mut self, event: &EventEnvelope<A>);
}
Expand description

A View represents a materialized view, generally serialized for persistence, that is updated by a query. This a read element in a CQRS system.

Required Methods§

source

fn update(&mut self, event: &EventEnvelope<A>)

Each implemented view is responsible for updating its state based on events passed via this method.

Object Safety§

This trait is not object safe.

Implementors§