pub enum SliceStrategy {
Never,
Ratio(f32),
MinimumSize(usize),
MaximumSize(usize),
}
Expand description
The strategy defines when to reuse chunk with slices.
Variants§
Never
Never use slices.
Ratio(f32)
Ratio needed before the chunk can be used as a slice. Between 0 and 1.
MinimumSize(usize)
When the reserved memory is at least {} bytes.
MaximumSize(usize)
When the reserved memory less than {} bytes.
Implementations§
source§impl SliceStrategy
impl SliceStrategy
sourcepub fn can_use_chunk(&self, chunk_size: usize, reserved_size: usize) -> bool
pub fn can_use_chunk(&self, chunk_size: usize, reserved_size: usize) -> bool
If the chunk can be used with a slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SliceStrategy
impl RefUnwindSafe for SliceStrategy
impl Send for SliceStrategy
impl Sync for SliceStrategy
impl Unpin for SliceStrategy
impl UnwindSafe for SliceStrategy
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