pub struct DroppedFileLru<T> { /* private fields */ }Expand description
Bounded monotonic-ID LRU registry (max 256) holding sandboxed dropped file handles.
Implementations§
Source§impl<T> DroppedFileLru<T>
impl<T> DroppedFileLru<T>
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
Sourcepub fn insert(&mut self, item: T) -> u64
pub fn insert(&mut self, item: T) -> u64
Inserts item under a fresh monotonic handle ID, evicting the least-recently-used entry
when at capacity.
Sourcepub fn get(&mut self, id: u64) -> Option<&T>
pub fn get(&mut self, id: u64) -> Option<&T>
Looks up id and promotes it to most-recently-used.
pub fn remove(&mut self, id: u64) -> Option<T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
Trait Implementations§
Source§impl<T: Clone> Clone for DroppedFileLru<T>
impl<T: Clone> Clone for DroppedFileLru<T>
Source§impl<T: Debug> Debug for DroppedFileLru<T>
impl<T: Debug> Debug for DroppedFileLru<T>
Auto Trait Implementations§
impl<T> Forget for DroppedFileLru<T>
impl<T> Freeze for DroppedFileLru<T>
impl<T> Move for DroppedFileLru<T>
impl<T> RefUnwindSafe for DroppedFileLru<T>where
T: RefUnwindSafe,
impl<T> Send for DroppedFileLru<T>
impl<T> Sync for DroppedFileLru<T>
impl<T> Unpin for DroppedFileLru<T>
impl<T> UnsafeUnpin for DroppedFileLru<T>
impl<T> UnwindSafe for DroppedFileLru<T>where
RawVecInner: UnwindSafe,
T: UnwindSafe,
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