pub struct TtlLruLimit { /* private fields */ }Implementations§
Source§impl TtlLruLimit
impl TtlLruLimit
Sourcepub fn new(size: usize, ttl: Duration, max: usize) -> Self
pub fn new(size: usize, ttl: Duration, max: usize) -> Self
Creates a new TTL-based LRU limit with the specified parameters.
§Arguments
size- The maximum number of entries to store in the LRU cachettl- The time-to-live duration after which entries are considered expiredmax- The maximum count allowed per key within the TTL window
Sourcepub fn new_compact(size: usize, ttl: Duration, max: usize) -> Self
pub fn new_compact(size: usize, ttl: Duration, max: usize) -> Self
Creates a new compact TTL-based LRU limit with the specified parameters.
§Arguments
size- The maximum number of entries to store in the LRU cachettl- The time-to-live duration after which entries are considered expired
Auto Trait Implementations§
impl !Freeze for TtlLruLimit
impl !RefUnwindSafe for TtlLruLimit
impl Send for TtlLruLimit
impl Sync for TtlLruLimit
impl Unpin for TtlLruLimit
impl !UnwindSafe for TtlLruLimit
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