use std::time::Duration;
#[derive(Clone, Debug)]
pub struct Policy {
max_capacity: Option<u64>,
time_to_live: Option<Duration>,
time_to_idle: Option<Duration>,
}
impl Policy {
pub(crate) fn new(
max_capacity: Option<u64>,
time_to_live: Option<Duration>,
time_to_idle: Option<Duration>,
) -> Self {
Self {
max_capacity,
time_to_live,
time_to_idle,
}
}
pub fn max_capacity(&self) -> Option<u64> {
self.max_capacity
}
pub fn time_to_live(&self) -> Option<Duration> {
self.time_to_live
}
pub fn time_to_idle(&self) -> Option<Duration> {
self.time_to_idle
}
}