pub struct SpeculativeCache { /* private fields */ }Implementations§
Source§impl SpeculativeCache
impl SpeculativeCache
pub fn new(max_size: usize, hit_threshold: f32) -> Self
pub fn pre_assemble( &mut self, predictions: Vec<String>, builder: impl Fn(&str) -> Option<(String, Vec<MemoryId>)>, )
pub fn try_hit(&mut self, query: &str) -> Option<&CacheEntry>
pub fn evict_stale(&mut self, max_age_us: u64, now: Timestamp)
pub fn stats(&self) -> CacheStats
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpeculativeCache
impl RefUnwindSafe for SpeculativeCache
impl Send for SpeculativeCache
impl Sync for SpeculativeCache
impl Unpin for SpeculativeCache
impl UnsafeUnpin for SpeculativeCache
impl UnwindSafe for SpeculativeCache
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