pub struct CacheConfig {
pub enabled: bool,
pub ttl: Duration,
pub max_size: usize,
pub cache_type: CacheType,
}Expand description
Configuration for cache behavior.
This struct defines the parameters that control cache behavior, including TTL, size limits, and cache type selection.
§Examples
use ultrafast_models_sdk::cache::{CacheConfig, CacheType};
use std::time::Duration;
let config = CacheConfig {
enabled: true,
ttl: Duration::from_secs(3600),
max_size: 1000,
cache_type: CacheType::InMemory,
};Fields§
§enabled: boolWhether caching is enabled
ttl: DurationTime-to-live for cached responses
max_size: usizeMaximum number of cached entries
cache_type: CacheTypeType of cache backend to use
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 CacheConfig
impl Debug for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnwindSafe for CacheConfig
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