pub struct CacheConfigData {
pub ttl_ms: u64,
pub min_tokens: usize,
pub cache_intervals: usize,
}Expand description
Serializable representation of CacheConfig.
Duration is stored as milliseconds for serde-friendliness.
Fields§
§ttl_ms: u64Time-to-live in milliseconds.
min_tokens: usizeMinimum token count for the cached prefix.
cache_intervals: usizeNumber of turns between cache refreshes.
Implementations§
Source§impl CacheConfigData
impl CacheConfigData
Sourcepub const fn to_cache_config(&self) -> CacheConfig
pub const fn to_cache_config(&self) -> CacheConfig
Convert back to a CacheConfig.
Trait Implementations§
Source§impl Clone for CacheConfigData
impl Clone for CacheConfigData
Source§fn clone(&self) -> CacheConfigData
fn clone(&self) -> CacheConfigData
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 CacheConfigData
impl Debug for CacheConfigData
Source§impl<'de> Deserialize<'de> for CacheConfigData
impl<'de> Deserialize<'de> for CacheConfigData
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
Source§impl From<&CacheConfig> for CacheConfigData
impl From<&CacheConfig> for CacheConfigData
Source§fn from(c: &CacheConfig) -> Self
fn from(c: &CacheConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CacheConfigData
impl RefUnwindSafe for CacheConfigData
impl Send for CacheConfigData
impl Sync for CacheConfigData
impl Unpin for CacheConfigData
impl UnsafeUnpin for CacheConfigData
impl UnwindSafe for CacheConfigData
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