pub trait MemoryUsage: Debug {
// Required methods
fn properties_required(&self) -> Properties;
fn memory_fitness(&self, properties: Properties) -> u32;
fn allocator_fitness(&self, kind: Kind) -> u32;
}Expand description
Memory usage trait.
Required Methods§
Sourcefn properties_required(&self) -> Properties
fn properties_required(&self) -> Properties
Get set of properties required for the usage.
Sourcefn memory_fitness(&self, properties: Properties) -> u32
fn memory_fitness(&self, properties: Properties) -> u32
Get comparable fitness value for memory properties.
§Panics
This function will panic if properties set doesn’t contain required properties.
Sourcefn allocator_fitness(&self, kind: Kind) -> u32
fn allocator_fitness(&self, kind: Kind) -> u32
Get comparable fitness value for memory allocator.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl MemoryUsage for Data
impl MemoryUsage for Download
impl MemoryUsage for Dynamic
impl MemoryUsage for MemoryUsageValue
Memory usage trait.