pub struct SharedBTreeMap<K: Copy + Ord + Default + 'static, V: Copy + Default + 'static> { /* private fields */ }Implementations§
pub fn create( path: impl AsRef<Path>, capacity: usize, ) -> Result<Self, BTreeError>
pub fn open( path: impl AsRef<Path>, expected_capacity: usize, ) -> Result<Self, BTreeError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> usize
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes bump-allocated so far (resident-memory witness:
node_count() * size_of::<BTreeNode>()).
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
True if key is present.
Sourcepub fn insert(&self, key: K, value: V) -> Result<Option<V>, BTreeError>
pub fn insert(&self, key: K, value: V) -> Result<Option<V>, BTreeError>
Insert / update. Single-writer (serialise externally). Returns the
previous value if key was present.
Sourcepub fn remove(&self, key: &K) -> Result<Option<V>, BTreeError>
pub fn remove(&self, key: &K) -> Result<Option<V>, BTreeError>
Remove key, returning its previous value if present. Single-writer
(serialise externally, as with insert).
Sourcepub fn iter_ascending(&self) -> Vec<(K, V)>
pub fn iter_ascending(&self) -> Vec<(K, V)>
Collect all (K, V) in ascending key order (validation / iteration).
pub fn flush(&self) -> Result<(), BTreeError>
Trait Implementations§
fn header(&self) -> &HandshakeHeader
fn ring(&self) -> &ObservationRing
fn make_policy(&self) -> Box<dyn Policy>
Source§fn apply_migration(&self, new_tag: u32)
fn apply_migration(&self, new_tag: u32)
Called by the sidecar when the policy returns a new strategy
tag. Default implementation: just set the tag on the header.
Primitives that need heavier migration (data-layout swap)
override this to perform the swap before (or after) updating
the tag.
Auto Trait Implementations§
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