pub struct PredictivePreheater<K>{ /* private fields */ }Expand description
Predictive Preheater
Analyzes access patterns and predicts future cache needs for proactive preheating. Uses machine learning techniques to optimize cache hit rates.
Implementations§
Source§impl<K> PredictivePreheater<K>
impl<K> PredictivePreheater<K>
Sourcepub fn new(config: PreheatingConfig) -> Self
pub fn new(config: PreheatingConfig) -> Self
Create a new predictive preheater
Sourcepub async fn record_access(&self, key: &K)
pub async fn record_access(&self, key: &K)
Record an access for pattern learning
Sourcepub async fn predict_and_preheat(&self, key: &K)
pub async fn predict_and_preheat(&self, key: &K)
Predict and schedule preheating for a key
Sourcepub async fn get_preheat_recommendations(&self) -> Vec<(K, f64)>
pub async fn get_preheat_recommendations(&self) -> Vec<(K, f64)>
Get preheating recommendations
Sourcepub fn calculate_cache_score(&self, key: &K) -> f64
pub fn calculate_cache_score(&self, key: &K) -> f64
Calculate cache score for a key
Sourcepub fn get_stats(&self) -> PreheatingStats
pub fn get_stats(&self) -> PreheatingStats
Get preheating statistics
Sourcepub async fn record_prediction_outcome(&self, _key: &K, was_hit: bool)
pub async fn record_prediction_outcome(&self, _key: &K, was_hit: bool)
Record prediction outcome for learning
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for PredictivePreheater<K>
impl<K> !RefUnwindSafe for PredictivePreheater<K>
impl<K> Send for PredictivePreheater<K>
impl<K> Sync for PredictivePreheater<K>
impl<K> Unpin for PredictivePreheater<K>
impl<K> UnsafeUnpin for PredictivePreheater<K>
impl<K> !UnwindSafe for PredictivePreheater<K>
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