pub trait Projection {
type Body: Body;
type State;
// Required methods
fn apply(&mut self, event: &Event<Self::Body>);
fn cursor(&self) -> u64;
fn state(&self) -> &Self::State;
}Expand description
A deterministic fold of the log into derived state. Rebuild, time-travel, and fork are all the same fold stopped at a different point (INV-1).
Required Associated Types§
Sourcetype Body: Body
type Body: Body
The payload type this projection folds. Ties the projection to a
Salamander<B> with the same B: you can only build a projection
from a log whose events carry the payload it knows how to apply.
Expressed as an associated type (not a trait parameter) so the
generic replay helpers below read as P: Projection with no extra
B to thread through.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".