pub struct AccessPattern {
pub key_hash: u64,
pub access_times: VecDeque<SystemTime>,
pub frequency: f64,
pub regularity: f64,
pub confidence: f64,
pub last_prediction: SystemTime,
pub accuracy_history: VecDeque<f64>,
}Expand description
Access pattern for a cache key
Fields§
§key_hash: u64Key identifier
access_times: VecDeque<SystemTime>Access timestamps
frequency: f64Access frequency (accesses per hour)
regularity: f64Access regularity score (0.0 to 1.0)
confidence: f64Prediction confidence (0.0 to 1.0)
last_prediction: SystemTimeLast prediction time
accuracy_history: VecDeque<f64>Prediction accuracy history
Implementations§
Source§impl AccessPattern
impl AccessPattern
Sourcepub fn record_access(&mut self, time: SystemTime)
pub fn record_access(&mut self, time: SystemTime)
Record a new access
Sourcepub fn predict_next_access(&self) -> Option<SystemTime>
pub fn predict_next_access(&self) -> Option<SystemTime>
Predict next access time
Sourcepub fn calculate_cache_score(&self) -> f64
pub fn calculate_cache_score(&self) -> f64
Calculate cache score for prioritization
Trait Implementations§
Source§impl Clone for AccessPattern
impl Clone for AccessPattern
Source§fn clone(&self) -> AccessPattern
fn clone(&self) -> AccessPattern
Returns a duplicate of the value. Read more
1.0.0 · 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 AccessPattern
impl Debug for AccessPattern
Source§impl<'de> Deserialize<'de> for AccessPattern
impl<'de> Deserialize<'de> for AccessPattern
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
Auto Trait Implementations§
impl Freeze for AccessPattern
impl RefUnwindSafe for AccessPattern
impl Send for AccessPattern
impl Sync for AccessPattern
impl Unpin for AccessPattern
impl UnwindSafe for AccessPattern
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