pub trait DeltaCrdt: CrdtMerge {
type Delta: Clone + Send + 'static;
// Required methods
fn take_delta(&mut self) -> Option<Self::Delta>;
fn merge_delta(&mut self, delta: &Self::Delta);
}Expand description
Optional delta-CRDT layer: emit a small “delta” describing the last local change and merge incoming deltas into the full state.
Phase 8.C of docs/full-port-plan.md. CRDTs that implement
DeltaCrdt participate in delta-gossip — the Replicator ships
Self::Delta to peers instead of the full state, dramatically
reducing wire traffic for hot keys.
CRDTs whose state is small (counters, flags) can implement this
trivially with Delta = Self. Sets / maps emit a sub-state
containing only the keys / tags that changed.
Required Associated Types§
Required Methods§
Sourcefn take_delta(&mut self) -> Option<Self::Delta>
fn take_delta(&mut self) -> Option<Self::Delta>
Take and clear the accumulated local delta. Returns None if
no local change has happened since the last call.
Sourcefn merge_delta(&mut self, delta: &Self::Delta)
fn merge_delta(&mut self, delta: &Self::Delta)
Merge an incoming delta into local state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".