pub struct SledDbOverlayStateDiff {
pub initial_tree_names: Vec<IVec>,
pub caches: BTreeMap<IVec, (SledTreeOverlayStateDiff, bool)>,
pub dropped_trees: BTreeMap<IVec, (SledTreeOverlayStateDiff, bool)>,
}Expand description
Auxilliary struct representing a SledDbOverlayState diff log.
Fields§
§initial_tree_names: Vec<IVec>Existing trees in db at the time of instantiation, so we can track newly opened trees.
caches: BTreeMap<IVec, (SledTreeOverlayStateDiff, bool)>State diff logs of all SledTreeOverlay instances that have been created,
along with a boolean flag indicating if it should be dropped. The drop flag
is always set to false, and change to true when we inverse the diff of a new
tree(not in our initial tree names) and the inserts vector is empty, indicating
that the tree should be dropped.
dropped_trees: BTreeMap<IVec, (SledTreeOverlayStateDiff, bool)>Trees that were dropped, along with their last state full diff, along with a boolean flag indicating if they should be restored. The restore flag is always set to false, and change to true when we inverse the diff, unless the tree is a new tree(not in our initial tree names).
Implementations§
Source§impl SledDbOverlayStateDiff
impl SledDbOverlayStateDiff
Sourcepub fn new(state: &SledDbOverlayState) -> Result<Self, Error>
pub fn new(state: &SledDbOverlayState) -> Result<Self, Error>
Instantiate a new SledDbOverlayStateDiff, over the provided
SledDbOverlayState. For newlly opened trees, all removed
keys are ignored. New trees that get droped are also ignored.
Sourcepub fn inverse(&self) -> Self
pub fn inverse(&self) -> Self
Produces a SledDbOverlayStateDiff containing the inverse
changes from our own.
Sourcepub fn remove_diff(&mut self, other: &Self)
pub fn remove_diff(&mut self, other: &Self)
Remove provided db overlay state changes from our own.
Trait Implementations§
Source§impl Clone for SledDbOverlayStateDiff
impl Clone for SledDbOverlayStateDiff
Source§fn clone(&self) -> SledDbOverlayStateDiff
fn clone(&self) -> SledDbOverlayStateDiff
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more