pub struct LruCache { /* private fields */ }Expand description
Simple LRU cache for text deduplication.
Maintains insertion order and evicts the oldest entry when capacity is reached. Note: Updating an existing key does NOT refresh its position (matches Go behavior).
§Example
use html_cleaning::dedup::LruCache;
let mut cache = LruCache::new(3);
cache.put("a", 1);
cache.put("b", 2);
assert_eq!(cache.get("a"), Some(1));
assert!(cache.has("b"));Implementations§
Auto Trait Implementations§
impl Freeze for LruCache
impl RefUnwindSafe for LruCache
impl Send for LruCache
impl Sync for LruCache
impl Unpin for LruCache
impl UnsafeUnpin for LruCache
impl UnwindSafe for LruCache
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