pub trait GetSize: Sized {
    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

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.

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.

Determines the total size of the object.

The default implementation simply adds up the result of the other two methods and is not meant to be changed.

Implementations on Foreign Types

Implementors