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§
Sourcefn est_bytes(&self) -> usize
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§
impl ByteSize for Array
ByteSize for Array enum
impl ByteSize for NumericArray
ByteSize for NumericArray enum
impl ByteSize for TemporalArray
datetime only.ByteSize for TemporalArray enum (when datetime feature is enabled)
impl ByteSize for TextArray
ByteSize for TextArray enum
impl ByteSize for Scalar
value_type and scalar_type only.ByteSize for Scalar (when scalar_type feature is enabled)
impl ByteSize for Value
value_type only.ByteSize for Value enum - delegates to inner types
impl ByteSize for Bitmask
ByteSize for Bitmask - bit-packed bitmask
impl ByteSize for SuperArray
chunked only.impl ByteSize for SuperTable
chunked only.impl ByteSize for Cube
cube only.impl ByteSize for Field
ByteSize for Field - metadata only, minimal size
impl ByteSize for FieldArray
ByteSize for FieldArray - field metadata + array data
impl ByteSize for Matrix
matrix only.impl ByteSize for Table
ByteSize for Table - sum of all column arrays
impl<T> ByteSize for Vec64<T>
ByteSize for Vec64
impl<T> ByteSize for Buffer<T>
ByteSize for Buffer
impl<T> ByteSize for BooleanArray<T>
ByteSize for BooleanArray
impl<T> ByteSize for DatetimeArray<T>
datetime only.impl<T> ByteSize for FloatArray<T>
ByteSize for FloatArray
impl<T> ByteSize for IntegerArray<T>
ByteSize for IntegerArray
impl<T> ByteSize for StringArray<T>
ByteSize for StringArray
impl<T: Integer> ByteSize for CategoricalArray<T>
ByteSize for CategoricalArray