pub trait GetSize: Sized {
// Provided methods
fn get_stack_size() -> usize { ... }
fn get_heap_size(&self) -> usize { ... }
fn get_size(&self) -> usize { ... }
}
Expand description
Determine the size in bytes an object occupies inside RAM.
Provided Methods§
sourcefn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack.
The default implementation uses std::mem::size_of and should work for almost all types.
sourcefn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap.
The default implementation returns 0, assuming the object is fully allocated on the stack. It must be adjusted as appropriate for objects which hold data inside the heap.