pub struct FifoCache { /* private fields */ }Expand description
A FIFO cache, that shares global state along all incoming requests of a policy.
As the name suggests, a FIFO eviction strategy is used, meaning that when the maximum number of entries is reached, the first added cache entries will be the first to be evicted.
Implementations§
Trait Implementations§
Source§impl Cache for FifoCache
impl Cache for FifoCache
Source§fn save(&self, key: &str, value: Vec<u8>) -> Result<(), CacheError>
fn save(&self, key: &str, value: Vec<u8>) -> Result<(), CacheError>
Stores value in cache with provided key. Value should be already serialized. Read more
Source§fn get(&self, key: &str) -> Option<Vec<u8>>
fn get(&self, key: &str) -> Option<Vec<u8>>
Returns stored value in cache for provided key. Read more
Auto Trait Implementations§
impl !Freeze for FifoCache
impl !RefUnwindSafe for FifoCache
impl !Send for FifoCache
impl !Sync for FifoCache
impl !UnwindSafe for FifoCache
impl Unpin for FifoCache
impl UnsafeUnpin for FifoCache
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