pub struct EstimatedBTreeMap<K, V> {
inner: BTreeMap<K, V>,
heap_size: KvSize,
}
Fields§
§inner: BTreeMap<K, V>
§heap_size: KvSize
Implementations§
source§impl<K, V> EstimatedBTreeMap<K, V>
impl<K, V> EstimatedBTreeMap<K, V>
pub fn new() -> Self
pub fn inner(&self) -> &BTreeMap<K, V>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&K, &V)>
pub fn range<R>(&self, range: R) -> Range<'_, K, V>where
K: Ord,
R: RangeBounds<K>,
pub fn values(&self) -> impl Iterator<Item = &V>
source§impl<K, V> EstimatedBTreeMap<K, V>where
K: Ord,
impl<K, V> EstimatedBTreeMap<K, V>where
K: Ord,
source§impl<K, V> EstimatedBTreeMap<K, V>
impl<K, V> EstimatedBTreeMap<K, V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn clear(&mut self)
pub fn pop_first(&mut self) -> Option<(K, V)>
pub fn pop_last(&mut self) -> Option<(K, V)>
pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>>
sourcepub fn retain_range(
&mut self,
range: RangeInclusive<&K>,
) -> (BTreeMap<K, V>, BTreeMap<K, V>)where
K: Clone,
pub fn retain_range(
&mut self,
range: RangeInclusive<&K>,
) -> (BTreeMap<K, V>, BTreeMap<K, V>)where
K: Clone,
Retain the given range of entries in the map, removing others.
pub fn extract_if<'a, F>( &'a mut self, pred: F, ) -> ExtractIf<'a, K, V, impl FnMut(&K, &mut V) -> bool> ⓘ
pub fn retain<F>(&mut self, f: F)
Trait Implementations§
source§impl<K: Clone, V: Clone> Clone for EstimatedBTreeMap<K, V>
impl<K: Clone, V: Clone> Clone for EstimatedBTreeMap<K, V>
source§fn clone(&self) -> EstimatedBTreeMap<K, V>
fn clone(&self) -> EstimatedBTreeMap<K, V>
Returns a copy 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<K, V> Debug for EstimatedBTreeMap<K, V>
impl<K, V> Debug for EstimatedBTreeMap<K, V>
source§impl<K, V> Default for EstimatedBTreeMap<K, V>
impl<K, V> Default for EstimatedBTreeMap<K, V>
source§impl<K, V> EstimateSize for EstimatedBTreeMap<K, V>where
K: EstimateSize,
V: EstimateSize,
impl<K, V> EstimateSize for EstimatedBTreeMap<K, V>where
K: EstimateSize,
V: EstimateSize,
source§fn estimated_heap_size(&self) -> usize
fn estimated_heap_size(&self) -> usize
The estimated heap size of the current struct in bytes.
source§fn estimated_size(&self) -> usizewhere
Self: Sized,
fn estimated_size(&self) -> usizewhere
Self: Sized,
The estimated total size of the current struct in bytes, including the
estimated_heap_size
and the size of Self
.Auto Trait Implementations§
impl<K, V> !Freeze for EstimatedBTreeMap<K, V>
impl<K, V> RefUnwindSafe for EstimatedBTreeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for EstimatedBTreeMap<K, V>
impl<K, V> Sync for EstimatedBTreeMap<K, V>
impl<K, V> Unpin for EstimatedBTreeMap<K, V>
impl<K, V> UnwindSafe for EstimatedBTreeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)