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
const IS_DYNAMIC: bool
const IS_DYNAMIC: bool
If true
, the type has a heap size that can vary at runtime, depending on the actual value.
const STATIC_HEAP_SIZE: usize
const STATIC_HEAP_SIZE: usize
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
fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
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
.