pub trait MutationBuffer:
Any
+ Send
+ Sync {
// Required methods
fn stage_insert(&mut self, row: &[Value]);
fn stage_remove(&mut self, key: &[Value]);
fn fresh_handle(&self) -> Box<dyn MutationBuffer>;
}Expand description
A trait specifying a buffer of pending mutations for a Table.
Dropping an object implementing this trait should “flush” the pending
mutations to the table. Calling Table::merge on that table would then
apply those mutations, making them visible for future readers.
Required Methods§
Sourcefn stage_insert(&mut self, row: &[Value])
fn stage_insert(&mut self, row: &[Value])
Stage the keyed entries for insertion. Changes may not be visible until
this buffer is dropped, and after merge is called on the underlying
table.
Sourcefn stage_remove(&mut self, key: &[Value])
fn stage_remove(&mut self, key: &[Value])
Stage the keyed entries for removal. Changes may not be visible until
this buffer is dropped, and after merge is called on the underlying
table.
Sourcefn fresh_handle(&self) -> Box<dyn MutationBuffer>
fn fresh_handle(&self) -> Box<dyn MutationBuffer>
Get a fresh handle to the same table.