pub struct SledDbOverlayState {
pub initial_tree_names: Vec<IVec>,
pub new_tree_names: Vec<IVec>,
pub caches: BTreeMap<IVec, SledTreeOverlay>,
pub dropped_trees: BTreeMap<IVec, SledTreeOverlayStateDiff>,
pub protected_tree_names: Vec<IVec>,
}Expand description
Struct representing SledDbOverlay cache state
Fields§
§initial_tree_names: Vec<IVec>Existing trees in db at the time of instantiation, so we can track newly opened trees.
new_tree_names: Vec<IVec>New trees that have been opened, but didn’t exist in db before.
caches: BTreeMap<IVec, SledTreeOverlay>Pointers to SledTreeOverlay instances that have been created.
dropped_trees: BTreeMap<IVec, SledTreeOverlayStateDiff>Trees that were dropped, along with their last state full diff.
protected_tree_names: Vec<IVec>Protected trees, that we don’t allow their removal, and don’t drop their references if they become stale.
Implementations§
Source§impl SledDbOverlayState
impl SledDbOverlayState
Sourcepub fn new(
initial_tree_names: Vec<IVec>,
protected_tree_names: Vec<IVec>,
) -> Self
pub fn new( initial_tree_names: Vec<IVec>, protected_tree_names: Vec<IVec>, ) -> Self
Instantiate a new SledDbOverlayState.
Sourcepub fn add_diff(
&mut self,
db: &Db,
diff: &SledDbOverlayStateDiff,
) -> Result<(), Error>
pub fn add_diff( &mut self, db: &Db, diff: &SledDbOverlayStateDiff, ) -> Result<(), Error>
Add provided db overlay state changes to our own.
Sourcepub fn remove_diff(&mut self, diff: &SledDbOverlayStateDiff)
pub fn remove_diff(&mut self, diff: &SledDbOverlayStateDiff)
Remove provided db overlay state changes from our own.
Trait Implementations§
Source§impl Clone for SledDbOverlayState
impl Clone for SledDbOverlayState
Source§fn clone(&self) -> SledDbOverlayState
fn clone(&self) -> SledDbOverlayState
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 SledDbOverlayState
impl Debug for SledDbOverlayState
Auto Trait Implementations§
impl Freeze for SledDbOverlayState
impl !RefUnwindSafe for SledDbOverlayState
impl Send for SledDbOverlayState
impl Sync for SledDbOverlayState
impl Unpin for SledDbOverlayState
impl !UnwindSafe for SledDbOverlayState
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