pub enum AllocationStrategy {
BestFit,
PowerOfTwo,
Static,
}Expand description
Describes generically an AllocationStrategy, meaning how the memory is increased when the
available memory is insufficient.
Variants§
BestFit
Increases the memory so that it perfectly fits the new size requirements. This may lead to a lot of reallocations but has the benefit that no byte is wasted.
PowerOfTwo
Increases the memory by rounding the increased memory size up to the next power of two. Reduces reallocations a lot at the cost of increased memory usage.
Static
The memory is not increased. This may lead to an out-of-memory error when allocating.
Trait Implementations§
Source§impl Clone for AllocationStrategy
impl Clone for AllocationStrategy
Source§fn clone(&self) -> AllocationStrategy
fn clone(&self) -> AllocationStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AllocationStrategy
impl Debug for AllocationStrategy
Source§impl Default for AllocationStrategy
impl Default for AllocationStrategy
Source§fn default() -> AllocationStrategy
fn default() -> AllocationStrategy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AllocationStrategy
impl<'de> Deserialize<'de> for AllocationStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AllocationStrategy
impl PartialEq for AllocationStrategy
Source§fn eq(&self, other: &AllocationStrategy) -> bool
fn eq(&self, other: &AllocationStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AllocationStrategy
impl Serialize for AllocationStrategy
impl Copy for AllocationStrategy
impl Eq for AllocationStrategy
impl StructuralPartialEq for AllocationStrategy
Auto Trait Implementations§
impl Freeze for AllocationStrategy
impl RefUnwindSafe for AllocationStrategy
impl Send for AllocationStrategy
impl Sync for AllocationStrategy
impl Unpin for AllocationStrategy
impl UnsafeUnpin for AllocationStrategy
impl UnwindSafe for AllocationStrategy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more