pub struct SessionCache { /* private fields */ }Implementations§
Source§impl SessionCache
impl SessionCache
pub fn new() -> Self
pub fn get_file_ref(&mut self, path: &str) -> String
pub fn get_file_ref_readonly(&self, path: &str) -> Option<String>
pub fn get(&self, path: &str) -> Option<&CacheEntry>
pub fn record_cache_hit(&mut self, path: &str) -> Option<&CacheEntry>
pub fn store(&mut self, path: &str, content: String) -> (CacheEntry, bool)
pub fn total_cached_tokens(&self) -> usize
Sourcepub fn evict_if_needed(&mut self, incoming_tokens: usize)
pub fn evict_if_needed(&mut self, incoming_tokens: usize)
Evict lowest-scoring entries until cache fits within token budget.
pub fn get_all_entries(&self) -> Vec<(&String, &CacheEntry)>
pub fn get_stats(&self) -> &CacheStats
pub fn file_ref_map(&self) -> &HashMap<String, String>
Sourcepub fn apply_dedup(&self, path: &str, content: &str) -> Option<String>
pub fn apply_dedup(&self, path: &str, content: &str) -> Option<String>
Replace shared blocks in content with cross-file references.
pub fn invalidate(&mut self, path: &str) -> bool
pub fn clear(&mut self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionCache
impl RefUnwindSafe for SessionCache
impl Send for SessionCache
impl Sync for SessionCache
impl Unpin for SessionCache
impl UnsafeUnpin for SessionCache
impl UnwindSafe for SessionCache
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