pub struct DeltaBatch {
pub deltas: Vec<StateDelta>,
pub combined_clock: VectorClock,
}Expand description
A batch of deltas that can be applied together.
Batching reduces network overhead when multiple deltas need to be transmitted.
Fields§
§deltas: Vec<StateDelta>The deltas in this batch, in causal order
combined_clock: VectorClockCombined clock covering all deltas
Implementations§
Source§impl DeltaBatch
impl DeltaBatch
Sourcepub fn push(&mut self, delta: StateDelta)
pub fn push(&mut self, delta: StateDelta)
Add a delta to the batch.
Sourcepub fn combine_additive(&self) -> Option<GA3>
pub fn combine_additive(&self) -> Option<GA3>
Combine all additive deltas into a single delta.
This only works for additive deltas; mixed batches are not combined.
Sourcepub fn estimated_size(&self) -> usize
pub fn estimated_size(&self) -> usize
Get the estimated total size in bytes.
Trait Implementations§
Source§impl Clone for DeltaBatch
impl Clone for DeltaBatch
Source§fn clone(&self) -> DeltaBatch
fn clone(&self) -> DeltaBatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeltaBatch
impl Debug for DeltaBatch
Source§impl Default for DeltaBatch
impl Default for DeltaBatch
Source§impl<'de> Deserialize<'de> for DeltaBatch
impl<'de> Deserialize<'de> for DeltaBatch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeltaBatch
impl RefUnwindSafe for DeltaBatch
impl Send for DeltaBatch
impl Sync for DeltaBatch
impl Unpin for DeltaBatch
impl UnsafeUnpin for DeltaBatch
impl UnwindSafe for DeltaBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more