risingwave_common_estimate_size::collections::btreemap

Struct EstimatedBTreeMap

source
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>

source

pub fn new() -> Self

source

pub fn inner(&self) -> &BTreeMap<K, V>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = (&K, &V)>

source

pub fn range<R>(&self, range: R) -> Range<'_, K, V>
where K: Ord, R: RangeBounds<K>,

source

pub fn values(&self) -> impl Iterator<Item = &V>

source§

impl<K, V> EstimatedBTreeMap<K, V>
where K: Ord,

source

pub fn first_key_value(&self) -> Option<(&K, &V)>

source

pub fn first_key(&self) -> Option<&K>

source

pub fn first_value(&self) -> Option<&V>

source

pub fn last_key_value(&self) -> Option<(&K, &V)>

source

pub fn last_key(&self) -> Option<&K>

source

pub fn last_value(&self) -> Option<&V>

source§

impl<K, V> EstimatedBTreeMap<K, V>
where K: EstimateSize + Ord, V: EstimateSize,

source

pub fn insert(&mut self, key: K, value: V) -> Option<V>

source

pub fn remove(&mut self, key: &K) -> Option<V>

source

pub fn clear(&mut self)

source

pub fn pop_first(&mut self) -> Option<(K, V)>

source

pub fn pop_last(&mut self) -> Option<(K, V)>

source

pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>>

source

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.

source

pub fn extract_if<'a, F>( &'a mut self, pred: F, ) -> ExtractIf<'a, K, V, impl FnMut(&K, &mut V) -> bool>
where F: 'a + FnMut(&K, &V) -> bool,

source

pub fn retain<F>(&mut self, f: F)
where F: FnMut(&K, &V) -> bool,

Trait Implementations§

source§

impl<K: Clone, V: Clone> Clone for EstimatedBTreeMap<K, V>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<K, V> Debug for EstimatedBTreeMap<K, V>
where K: Debug, V: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, V> Default for EstimatedBTreeMap<K, V>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<K, V> EstimateSize for EstimatedBTreeMap<K, V>

source§

fn estimated_heap_size(&self) -> usize

The estimated heap size of the current struct in bytes.
source§

fn estimated_size(&self) -> usize
where 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>

§

impl<K, V> Send for EstimatedBTreeMap<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for EstimatedBTreeMap<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for EstimatedBTreeMap<K, V>

§

impl<K, V> UnwindSafe for EstimatedBTreeMap<K, V>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V