ByteSize

Trait ByteSize 

Source
pub trait ByteSize {
    // Required method
    fn est_bytes(&self) -> usize;
}
Expand description

Trait for estimating the memory footprint of a type.

Returns the estimated number of bytes occupied by the object in memory, including all owned data buffers, masks, and nested structures.

For types with directly calculatable sizes (e.g., n * size_of::<T>()), this returns the exact value. For complex types, this provides a best estimate.

Required Methods§

Source

fn est_bytes(&self) -> usize

Returns the estimated byte size of this object in memory.

This includes:

  • Data buffers (values, offsets, indices)
  • Null masks (bitmaps)
  • Dictionary data (for categorical types)
  • Nested structures (for recursive types)

Does not include:

  • Stack size of the struct itself (only heap allocations)
  • Arc pointer overhead (counted once per allocation, not per reference)

Implementors§

Source§

impl ByteSize for Array

ByteSize for Array enum

Source§

impl ByteSize for NumericArray

ByteSize for NumericArray enum

Source§

impl ByteSize for TemporalArray

Available on crate feature datetime only.

ByteSize for TemporalArray enum (when datetime feature is enabled)

Source§

impl ByteSize for TextArray

ByteSize for TextArray enum

Source§

impl ByteSize for Scalar

Available on crate features value_type and scalar_type only.

ByteSize for Scalar (when scalar_type feature is enabled)

Source§

impl ByteSize for Value

Available on crate feature value_type only.

ByteSize for Value enum - delegates to inner types

Source§

impl ByteSize for Bitmask

ByteSize for Bitmask - bit-packed bitmask

Source§

impl ByteSize for SuperArray

Available on crate feature chunked only.
Source§

impl ByteSize for SuperTable

Available on crate feature chunked only.
Source§

impl ByteSize for Cube

Available on crate feature cube only.
Source§

impl ByteSize for Field

ByteSize for Field - metadata only, minimal size

Source§

impl ByteSize for FieldArray

ByteSize for FieldArray - field metadata + array data

Source§

impl ByteSize for Matrix

Available on crate feature matrix only.
Source§

impl ByteSize for Table

ByteSize for Table - sum of all column arrays

Source§

impl<T> ByteSize for Vec64<T>

ByteSize for Vec64 - 64-byte aligned vector

Source§

impl<T> ByteSize for Buffer<T>

ByteSize for Buffer - unified owned/shared buffer

Source§

impl<T> ByteSize for BooleanArray<T>

ByteSize for BooleanArray

Source§

impl<T> ByteSize for DatetimeArray<T>

Available on crate feature datetime only.
Source§

impl<T> ByteSize for FloatArray<T>

ByteSize for FloatArray

Source§

impl<T> ByteSize for IntegerArray<T>

ByteSize for IntegerArray

Source§

impl<T> ByteSize for StringArray<T>

ByteSize for StringArray

Source§

impl<T: Integer> ByteSize for CategoricalArray<T>

ByteSize for CategoricalArray