pub struct FetchCacheConfig { /* private fields */ }Expand description
Independently bounded TTL, entry-count, and byte limits for fetch caching.
Implementations§
Source§impl FetchCacheConfig
impl FetchCacheConfig
Sourcepub fn new(
ttl: Duration,
max_entries: usize,
max_total_bytes: usize,
max_entry_bytes: usize,
) -> Result<Self, FetchProviderError>
pub fn new( ttl: Duration, max_entries: usize, max_total_bytes: usize, max_entry_bytes: usize, ) -> Result<Self, FetchProviderError>
Creates a bounded cache configuration.
§Errors
Rejects zero values, values above absolute limits, or a per-entry byte limit larger than the aggregate byte limit.
Sourcepub const fn max_entries(self) -> usize
pub const fn max_entries(self) -> usize
Returns the maximum entry count.
Sourcepub const fn max_total_bytes(self) -> usize
pub const fn max_total_bytes(self) -> usize
Returns the aggregate logical byte limit.
Sourcepub const fn max_entry_bytes(self) -> usize
pub const fn max_entry_bytes(self) -> usize
Returns the per-entry logical byte limit.
Trait Implementations§
Source§impl Clone for FetchCacheConfig
impl Clone for FetchCacheConfig
impl Copy for FetchCacheConfig
Source§impl Debug for FetchCacheConfig
impl Debug for FetchCacheConfig
Source§impl Default for FetchCacheConfig
impl Default for FetchCacheConfig
impl Eq for FetchCacheConfig
Source§impl PartialEq for FetchCacheConfig
impl PartialEq for FetchCacheConfig
impl StructuralPartialEq for FetchCacheConfig
Auto Trait Implementations§
impl Freeze for FetchCacheConfig
impl RefUnwindSafe for FetchCacheConfig
impl Send for FetchCacheConfig
impl Sync for FetchCacheConfig
impl Unpin for FetchCacheConfig
impl UnsafeUnpin for FetchCacheConfig
impl UnwindSafe for FetchCacheConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.