Struct lasso::MemoryLimits
source · pub struct MemoryLimits { /* private fields */ }
Expand description
Settings for the memory consumption of an interner
By default max_memory_usage
is set to usize::MAX
Implementations§
source§impl MemoryLimits
impl MemoryLimits
sourcepub fn new(max_memory_usage: usize) -> Self
pub fn new(max_memory_usage: usize) -> Self
Create a new MemoryLimits
with the number of bytes that the interner can allocate
sourcepub fn for_memory_usage(max_memory_usage: usize) -> Self
pub fn for_memory_usage(max_memory_usage: usize) -> Self
Create a new MemoryLimits
with the number of bytes that the interner can allocate
sourcepub fn max_memory_usage(&self) -> usize
pub fn max_memory_usage(&self) -> usize
Returns the maximum memory usage this MemoryLimits
can allocate
Trait Implementations§
source§impl Clone for MemoryLimits
impl Clone for MemoryLimits
source§fn clone(&self) -> MemoryLimits
fn clone(&self) -> MemoryLimits
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MemoryLimits
impl Debug for MemoryLimits
source§impl Default for MemoryLimits
impl Default for MemoryLimits
Creates a MemoryLimits
with max_memory_usage
set to usize::max_value()
source§impl Hash for MemoryLimits
impl Hash for MemoryLimits
source§impl Ord for MemoryLimits
impl Ord for MemoryLimits
source§fn cmp(&self, other: &MemoryLimits) -> Ordering
fn cmp(&self, other: &MemoryLimits) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<MemoryLimits> for MemoryLimits
impl PartialEq<MemoryLimits> for MemoryLimits
source§fn eq(&self, other: &MemoryLimits) -> bool
fn eq(&self, other: &MemoryLimits) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MemoryLimits> for MemoryLimits
impl PartialOrd<MemoryLimits> for MemoryLimits
source§fn partial_cmp(&self, other: &MemoryLimits) -> Option<Ordering>
fn partial_cmp(&self, other: &MemoryLimits) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more