micro-moka 0.1.13

A lightweight, single-threaded cache library with W-TinyLFU eviction
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Clone, Debug)]
/// The policy of a cache.
pub struct Policy {
    max_capacity: Option<u64>,
}

impl Policy {
    pub(crate) fn new(max_capacity: Option<u64>) -> Self {
        Self { max_capacity }
    }

    /// Returns the `max_capacity` of the cache.
    pub fn max_capacity(&self) -> Option<u64> {
        self.max_capacity
    }
}