Trait bevy_datasize::DataSizeEstimator[][src]

pub trait DataSizeEstimator<T: ?Sized> {
    const IS_DYNAMIC: bool;

    fn estimate_heap_size(&self, value: &T) -> usize;
}
Expand description

Indicates that a type can estimate the heap usage of values of type T.

This trait exists in order to work around the fact that this crate cannot add impls of DataSize to types from the Bevy crate(s).

Associated Constants

If true, the type T has a heap size that can vary at runtime, depending on the actual value.

Required methods

Estimates the size of heap memory taken up by the given value.

Does not include data on the stack, which is usually determined using std::mem::size_of.

Implementors