pub struct MutationBatch {
pub base_revision: Option<u64>,
pub ops: Vec<Box<dyn MutationOp>>,
pub touched_keys: Vec<String>,
}Expand description
A batch of state mutation operations.
Collects typed key updates and applies them atomically to a Snapshot.
Fields§
§base_revision: Option<u64>§ops: Vec<Box<dyn MutationOp>>§touched_keys: Vec<String>Implementations§
Source§impl MutationBatch
impl MutationBatch
pub fn new() -> MutationBatch
pub fn with_base_revision(self, revision: u64) -> MutationBatch
pub fn base_revision(&self) -> Option<u64>
pub fn is_empty(&self) -> bool
pub fn update<K>(&mut self, update: <K as StateKey>::Update)where
K: StateKey,
pub fn clear_extension_with( &mut self, key: impl Into<String>, clear: fn(&mut StateMap), )
pub fn extend(&mut self, other: MutationBatch) -> Result<(), StateError>
pub fn op_len(&self) -> usize
Sourcepub fn merge_parallel<F>(
self,
other: MutationBatch,
strategy: F,
) -> Result<MutationBatch, StateError>
pub fn merge_parallel<F>( self, other: MutationBatch, strategy: F, ) -> Result<MutationBatch, StateError>
Merge two batches produced by parallel execution.
- Disjoint keys: always merged.
- Overlapping keys with
Commutativestrategy: merged (order irrelevant). - Overlapping keys with
Exclusivestrategy: returnsParallelMergeConflict.
Trait Implementations§
Source§impl Debug for MutationBatch
impl Debug for MutationBatch
Source§impl Default for MutationBatch
impl Default for MutationBatch
Source§fn default() -> MutationBatch
fn default() -> MutationBatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MutationBatch
impl !RefUnwindSafe for MutationBatch
impl Send for MutationBatch
impl !Sync for MutationBatch
impl Unpin for MutationBatch
impl UnsafeUnpin for MutationBatch
impl !UnwindSafe for MutationBatch
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