Updated directory caching

This commit is contained in:
mdecimus
2024-12-29 18:00:36 +01:00
parent c34f80c4f9
commit 30cf967623
28 changed files with 76 additions and 132 deletions

View File

@@ -301,6 +301,12 @@ impl CacheItemWeight for IpAddr {
}
}
impl CacheItemWeight for bool {
fn weight(&self) -> u64 {
std::mem::size_of::<bool>() as u64
}
}
impl<T: Clone + CacheItemWeight> TtlEntry<T> {
pub fn new(value: T, expires: Duration) -> Self {
Self {