pub struct ModelCacheConfig {
pub max_models: usize,
pub ttl: Duration,
pub evict_on_memory_pressure: bool,
pub memory_budget_bytes: Option<usize>,
}Expand description
Configuration for ModelCache.
Fields§
§max_models: usizeMaximum number of model entries to keep in the cache simultaneously.
ttl: DurationTime-to-live: entries idle longer than this are eligible for eviction.
evict_on_memory_pressure: boolWhen true, the cache will proactively evict entries when the total
resident memory exceeds memory_budget_bytes.
memory_budget_bytes: Option<usize>Optional memory ceiling in bytes. When the aggregate memory_bytes of
all cached entries exceeds this value the least-recently-used entry is
evicted before inserting a new one.
Trait Implementations§
Source§impl Clone for ModelCacheConfig
impl Clone for ModelCacheConfig
Source§fn clone(&self) -> ModelCacheConfig
fn clone(&self) -> ModelCacheConfig
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 ModelCacheConfig
impl Debug for ModelCacheConfig
Auto Trait Implementations§
impl Freeze for ModelCacheConfig
impl RefUnwindSafe for ModelCacheConfig
impl Send for ModelCacheConfig
impl Sync for ModelCacheConfig
impl Unpin for ModelCacheConfig
impl UnsafeUnpin for ModelCacheConfig
impl UnwindSafe for ModelCacheConfig
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