micro_moka/
policy.rs

1#[derive(Clone, Debug)]
2/// The policy of a cache.
3pub struct Policy {
4    max_capacity: Option<u64>,
5}
6
7impl Policy {
8    pub(crate) fn new(
9        max_capacity: Option<u64>,
10    ) -> Self {
11        Self {
12            max_capacity,
13        }
14    }
15
16    /// Returns the `max_capacity` of the cache.
17    pub fn max_capacity(&self) -> Option<u64> {
18        self.max_capacity
19    }
20}