#[non_exhaustive]pub struct LocalSettings {
pub ttl_secs: u64,
pub memory: MemorySettings,
/* private fields */
}hybrid only.Expand description
The in-memory layer of a hybrid store: how long its copies live, and the memory store’s own
settings beside it. Its copies always expire: after ttl_secs, or when the entry they copy
does, if that is sooner.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ttl_secs: u64How long a node keeps a local copy: 60 seconds by default. A copy never outlives its
entry, so one with a shorter TTL left expires with it. It is also the longest a node serves
a stale copy when an invalidation is lost and nothing notices, so local copies can’t be
kept for good, even of an entry the distributed store keeps until removed. validate
rejects 0.
memory: MemorySettingsThe memory store’s own settings for the copies: max_entries, purge_interval_secs and
shards, which sit beside ttl_secs in a config file.
Implementations§
Source§impl LocalSettings
impl LocalSettings
Sourcepub fn validate(&self) -> Result<(), CacheError>
pub fn validate(&self) -> Result<(), CacheError>
Fails when ttl_secs is 0 or over 365 days, or a memory setting is out of range, as
MemorySettings::validate says.
Trait Implementations§
Source§impl Clone for LocalSettings
impl Clone for LocalSettings
Source§fn clone(&self) -> LocalSettings
fn clone(&self) -> LocalSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more