kutil_http/cache/implementation/moka/
builder.rs1use super::{
2 super::super::{key::*, response::*},
3 expiry::*,
4 weigher::*,
5};
6
7pub trait ForHttpResponse: Sized {
13 fn for_http_response(self) -> Self;
15}
16
17impl<CacheKeyT> ForHttpResponse
18 for moka::future::CacheBuilder<CacheKeyT, CachedResponseRef, moka::future::Cache<CacheKeyT, CachedResponseRef>>
19where
20 CacheKeyT: CacheKey,
21{
22 fn for_http_response(self) -> Self {
23 self.weigher(weigher).expire_after(CachedResponseExpiry)
24 }
25}