pub struct AdaptiveCacheConfig {
pub max_memory_bytes: usize,
pub soft_limit_fraction: f32,
pub hard_limit_fraction: f32,
pub eviction_strategy: EvictionStrategy,
pub learn_patterns: bool,
pub default_ttl: Option<Duration>,
pub disk_cache_enabled: bool,
pub disk_cache_dir: Option<PathBuf>,
pub max_disk_cache_bytes: usize,
}Expand description
Adaptive cache configuration
Fields§
§max_memory_bytes: usizeMaximum memory budget in bytes
soft_limit_fraction: f32Soft limit (trigger eviction) as fraction of max
hard_limit_fraction: f32Hard limit (aggressive eviction) as fraction of max
eviction_strategy: EvictionStrategyEviction strategy
learn_patterns: boolEnable access pattern learning
default_ttl: Option<Duration>Default entry TTL (time to live)
disk_cache_enabled: boolEnable disk-backed cache
disk_cache_dir: Option<PathBuf>Disk cache directory
max_disk_cache_bytes: usizeMaximum disk cache size
Trait Implementations§
Source§impl Clone for AdaptiveCacheConfig
impl Clone for AdaptiveCacheConfig
Source§impl Debug for AdaptiveCacheConfig
impl Debug for AdaptiveCacheConfig
Source§impl Default for AdaptiveCacheConfig
impl Default for AdaptiveCacheConfig
Source§impl<'de> Deserialize<'de> for AdaptiveCacheConfig
impl<'de> Deserialize<'de> for AdaptiveCacheConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AdaptiveCacheConfig
impl RefUnwindSafe for AdaptiveCacheConfig
impl Send for AdaptiveCacheConfig
impl Sync for AdaptiveCacheConfig
impl Unpin for AdaptiveCacheConfig
impl UnsafeUnpin for AdaptiveCacheConfig
impl UnwindSafe for AdaptiveCacheConfig
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<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
Source§fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
Save to file
Source§fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
Load from file
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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