pub enum PrefetchStrategy {
Sequential {
lookahead: usize,
},
AccessPattern(Vec<String>),
}Expand description
Strategy controlling which keys the prefetcher will pre-warm.
Variants§
Sequential
Assume keys are named like "segment-NNN".
On access to key "segment-N", pre-fetch "segment-(N+1)" through
"segment-(N+lookahead)".
AccessPattern(Vec<String>)
Follow a fixed ordered access pattern.
On access to key K, the next key in the pattern list is pre-warmed.
When the end of the list is reached, the pattern wraps around.
Implementations§
Source§impl PrefetchStrategy
impl PrefetchStrategy
Sourcepub fn predict_next(&self, current_key: &str) -> Vec<String>
pub fn predict_next(&self, current_key: &str) -> Vec<String>
Given the current_key, predict the next keys to prefetch.
Returns an empty vec when no prediction is possible.
Trait Implementations§
Source§impl Clone for PrefetchStrategy
impl Clone for PrefetchStrategy
Source§fn clone(&self) -> PrefetchStrategy
fn clone(&self) -> PrefetchStrategy
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 moreAuto Trait Implementations§
impl Freeze for PrefetchStrategy
impl RefUnwindSafe for PrefetchStrategy
impl Send for PrefetchStrategy
impl Sync for PrefetchStrategy
impl Unpin for PrefetchStrategy
impl UnsafeUnpin for PrefetchStrategy
impl UnwindSafe for PrefetchStrategy
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