pub struct CacheEntryScorer { /* private fields */ }Expand description
Scores importance of KV cache entries
Implementations§
Source§impl CacheEntryScorer
impl CacheEntryScorer
Sourcepub fn new(config: CacheScoringConfig) -> Self
pub fn new(config: CacheScoringConfig) -> Self
Create a new cache entry scorer
Sourcepub fn score_entry(&self, params: CacheEntryParams<'_>) -> f32
pub fn score_entry(&self, params: CacheEntryParams<'_>) -> f32
Score a KV cache entry based on various factors
pub fn update_engagement(&mut self, key_hash: &str, was_retrieved: bool)
Trait Implementations§
Source§impl CacheEntryScorer for CacheEntryScorer
Implementation of the trait required by the cache_extractor module
impl CacheEntryScorer for CacheEntryScorer
Implementation of the trait required by the cache_extractor module
Auto Trait Implementations§
impl Freeze for CacheEntryScorer
impl RefUnwindSafe for CacheEntryScorer
impl Send for CacheEntryScorer
impl Sync for CacheEntryScorer
impl Unpin for CacheEntryScorer
impl UnsafeUnpin for CacheEntryScorer
impl UnwindSafe for CacheEntryScorer
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> 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