pub struct NegativeCacheConfig {
pub max_entries: usize,
pub timeout: Duration,
pub adaptive_ttl: Option<AdaptiveTtlConfig>,
}Expand description
Configuration for the negative cache.
Negative caching stores “file not found” results to avoid repeated
filesystem lookups for non-existent files. This is particularly effective
for directories like node_modules and .git where many lookups fail.
Fields§
§max_entries: usizeMaximum number of entries in the cache. When exceeded, expired entries are evicted. Default: 10000
timeout: DurationTime-to-live for cache entries. Entries older than this are considered stale. Default: 5 seconds
adaptive_ttl: Option<AdaptiveTtlConfig>Adaptive TTL configuration for path-pattern-based timeouts.
When set, insert_with_path uses per-path TTLs instead of the
global timeout value.
Implementations§
Trait Implementations§
Source§impl Clone for NegativeCacheConfig
impl Clone for NegativeCacheConfig
Source§fn clone(&self) -> NegativeCacheConfig
fn clone(&self) -> NegativeCacheConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NegativeCacheConfig
impl Debug for NegativeCacheConfig
Auto Trait Implementations§
impl Freeze for NegativeCacheConfig
impl RefUnwindSafe for NegativeCacheConfig
impl Send for NegativeCacheConfig
impl Sync for NegativeCacheConfig
impl Unpin for NegativeCacheConfig
impl UnsafeUnpin for NegativeCacheConfig
impl UnwindSafe for NegativeCacheConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more