pub enum OffsetCacheKind {
Linear {
offset: usize,
},
Quadratic,
}Expand description
Policy controlling how element file-positions are cached to accelerate [Iter::nth].
Variants§
Linear
Cache one position every offset elements.
This policy provides a fixed seek performance (O(offset)) at the cost of O(N/offset) memory usage.
Quadratic
Cache positions at indices that are perfect squares (1, 4, 9, 16, 25, …).
This policy provides a good trade-off between memory usage (O(√N)) and seek performance (O(√N)).
Trait Implementations§
Source§impl Clone for OffsetCacheKind
impl Clone for OffsetCacheKind
impl Copy for OffsetCacheKind
Source§impl Debug for OffsetCacheKind
impl Debug for OffsetCacheKind
impl Eq for OffsetCacheKind
Source§impl PartialEq for OffsetCacheKind
impl PartialEq for OffsetCacheKind
impl StructuralPartialEq for OffsetCacheKind
Auto Trait Implementations§
impl Freeze for OffsetCacheKind
impl RefUnwindSafe for OffsetCacheKind
impl Send for OffsetCacheKind
impl Sync for OffsetCacheKind
impl Unpin for OffsetCacheKind
impl UnsafeUnpin for OffsetCacheKind
impl UnwindSafe for OffsetCacheKind
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