pub trait GetSize {
const USES_DYN_MEM: bool = false;
fn size_bytes_dyn(&self) -> usize { ... }
fn size_bytes(&self) -> usize { ... }
}Expand description
Provides methods to get dynamic and total size of the variable.
Provided Associated Constants
const USES_DYN_MEM: bool = false
const USES_DYN_MEM: bool = false
true if and only if the variables of this type can use dynamic (heap) memory.
Provided Methods
fn size_bytes_dyn(&self) -> usize
fn size_bytes_dyn(&self) -> usize
Returns approximate number of bytes occupied by dynamic (heap) part of self.
Same as self.size_bytes() - std::mem::size_of_val(self).
fn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Returns approximate, total (including heap memory) number of bytes occupied by self.