Trait bevy_datasize::DataSize[][src]

pub trait DataSize {
    const IS_DYNAMIC: bool;
    const STATIC_HEAP_SIZE: usize;

    fn estimate_heap_size(&self) -> usize;
}
Expand description

Indicates that a type knows how to approximate its memory usage.

Associated Constants

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

The amount of space a value of the type always occupies. If IS_DYNAMIC is false, this is the total amount of heap memory occupied by the value. Otherwise this is a lower bound.

Required methods

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

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

Implementations on Foreign Types

Implementors