pub struct GraphQLQueryCache { /* private fields */ }Expand description
GraphQL query cache manager
Implementations§
Source§impl GraphQLQueryCache
impl GraphQLQueryCache
Sourcepub async fn new(config: CacheConfig) -> Result<Self>
pub async fn new(config: CacheConfig) -> Result<Self>
Create a new GraphQL query cache
Sourcepub async fn cache_query_result(
&self,
context: &QueryContext,
result: &Value,
ttl: Option<Duration>,
) -> Result<()>
pub async fn cache_query_result( &self, context: &QueryContext, result: &Value, ttl: Option<Duration>, ) -> Result<()>
Cache a GraphQL query result
Sourcepub async fn get_cached_result(
&self,
context: &QueryContext,
) -> Result<Option<Value>>
pub async fn get_cached_result( &self, context: &QueryContext, ) -> Result<Option<Value>>
Get cached GraphQL query result
Sourcepub async fn invalidate_on_schema_change(
&self,
schema_version: &str,
) -> Result<u64>
pub async fn invalidate_on_schema_change( &self, schema_version: &str, ) -> Result<u64>
Invalidate cache entries based on schema changes
Sourcepub async fn invalidate_for_services(
&self,
service_ids: &[String],
) -> Result<u64>
pub async fn invalidate_for_services( &self, service_ids: &[String], ) -> Result<u64>
Invalidate cache entries for specific services
Sourcepub async fn get_stats(&self) -> Result<CacheStats>
pub async fn get_stats(&self) -> Result<CacheStats>
Get cache statistics
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Health check
Auto Trait Implementations§
impl !RefUnwindSafe for GraphQLQueryCache
impl !UnwindSafe for GraphQLQueryCache
impl Freeze for GraphQLQueryCache
impl Send for GraphQLQueryCache
impl Sync for GraphQLQueryCache
impl Unpin for GraphQLQueryCache
impl UnsafeUnpin for GraphQLQueryCache
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 more