risingwave_common_estimate_size

Trait EstimateSize

source
pub trait EstimateSize {
    // Required method
    fn estimated_heap_size(&self) -> usize;

    // Provided method
    fn estimated_size(&self) -> usize
       where Self: Sized { ... }
}
Expand description

The trait for estimating the actual memory usage of a struct.

Used for cache eviction now.

Required Methods§

source

fn estimated_heap_size(&self) -> usize

The estimated heap size of the current struct in bytes.

Provided Methods§

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.

Implementations on Foreign Types§

source§

impl EstimateSize for Value

source§

impl EstimateSize for Box<str>

source§

impl EstimateSize for String

source§

impl EstimateSize for FixedBitSet

source§

impl EstimateSize for Builder

source§

impl EstimateSize for Bytes

SAFETY: Bytes can store a pointer in some cases, that may cause the size of a Bytes be calculated more than one and when memory stats is larger than the real value.

source§

impl EstimateSize for Value

source§

impl<T1: EstimateSize, T2: EstimateSize> EstimateSize for (T1, T2)

source§

impl<T: EstimateSize> EstimateSize for Option<T>

source§

impl<T: EstimateSize> EstimateSize for Reverse<T>

source§

impl<T: ZeroHeapSize> EstimateSize for Box<[T]>

source§

impl<T: ZeroHeapSize> EstimateSize for Vec<T>

source§

impl<T: ZeroHeapSize, const LEN: usize> EstimateSize for [T; LEN]

Implementors§