pub struct AdvancedCacheManager { /* private fields */ }Expand description
Main cache manager with multiple tiers
Implementations§
Source§impl AdvancedCacheManager
impl AdvancedCacheManager
pub fn new(config: CacheConfig) -> Self
Sourcepub fn generate_cache_key(query: &str, context: Option<&str>) -> String
pub fn generate_cache_key(query: &str, context: Option<&str>) -> String
Generate cache key from query and context
Sourcepub async fn cache_response(
&self,
key: String,
response: &LLMResponse,
quality_score: f32,
) -> Result<()>
pub async fn cache_response( &self, key: String, response: &LLMResponse, quality_score: f32, ) -> Result<()>
Cache a response
Sourcepub async fn get_cached_response(&self, key: &str) -> Option<CachedResponse>
pub async fn get_cached_response(&self, key: &str) -> Option<CachedResponse>
Get cached response
Sourcepub async fn cache_context(
&self,
key: String,
context: &AssembledContext,
) -> Result<()>
pub async fn cache_context( &self, key: String, context: &AssembledContext, ) -> Result<()>
Cache assembled context
Sourcepub async fn get_cached_context(&self, key: &str) -> Option<CachedContext>
pub async fn get_cached_context(&self, key: &str) -> Option<CachedContext>
Get cached context
Sourcepub async fn cache_embedding(
&self,
key: String,
embedding: Vec<f32>,
) -> Result<()>
pub async fn cache_embedding( &self, key: String, embedding: Vec<f32>, ) -> Result<()>
Cache embedding vector
Sourcepub async fn cache_query_result(
&self,
key: String,
sparql_query: String,
bindings: Vec<HashMap<String, String>>,
execution_time_ms: u64,
) -> Result<()>
pub async fn cache_query_result( &self, key: String, sparql_query: String, bindings: Vec<HashMap<String, String>>, execution_time_ms: u64, ) -> Result<()>
Cache SPARQL query result
Sourcepub async fn get_cached_query_result(
&self,
key: &str,
) -> Option<CachedQueryResult>
pub async fn get_cached_query_result( &self, key: &str, ) -> Option<CachedQueryResult>
Get cached query result
Sourcepub async fn get_cache_stats(&self) -> CacheStats
pub async fn get_cache_stats(&self) -> CacheStats
Get comprehensive cache statistics
Sourcepub async fn get_detailed_stats(&self) -> HashMap<String, CacheTierStats>
pub async fn get_detailed_stats(&self) -> HashMap<String, CacheTierStats>
Get detailed cache tier statistics
Sourcepub async fn optimize_configuration(&self) -> Result<CacheConfig>
pub async fn optimize_configuration(&self) -> Result<CacheConfig>
Optimize cache configuration based on usage patterns
Auto Trait Implementations§
impl !RefUnwindSafe for AdvancedCacheManager
impl !UnwindSafe for AdvancedCacheManager
impl Freeze for AdvancedCacheManager
impl Send for AdvancedCacheManager
impl Sync for AdvancedCacheManager
impl Unpin for AdvancedCacheManager
impl UnsafeUnpin for AdvancedCacheManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.