pub struct RedisCache { /* private fields */ }
Implementations§
Source§impl RedisCache
impl RedisCache
Sourcepub fn generate_key(
table_name: &str,
url: &str,
method: Option<&str>,
headers: &[(String, String)],
body: Option<&str>,
) -> String
pub fn generate_key( table_name: &str, url: &str, method: Option<&str>, headers: &[(String, String)], body: Option<&str>, ) -> String
Generate a cache key from Web CTE components (legacy - kept for compatibility)
Sourcepub fn generate_key_with_context(
table_name: &str,
url: &str,
method: Option<&str>,
headers: &[(String, String)],
body: Option<&str>,
query_context: &str,
) -> String
pub fn generate_key_with_context( table_name: &str, url: &str, method: Option<&str>, headers: &[(String, String)], body: Option<&str>, query_context: &str, ) -> String
Generate a cache key from Web CTE components with query context
Sourcepub fn generate_key_full(
table_name: &str,
url: &str,
method: Option<&str>,
headers: &[(String, String)],
body: Option<&str>,
_query_context: &str,
json_path: Option<&str>,
form_files: &[(String, String)],
form_fields: &[(String, String)],
) -> String
pub fn generate_key_full( table_name: &str, url: &str, method: Option<&str>, headers: &[(String, String)], body: Option<&str>, _query_context: &str, json_path: Option<&str>, form_files: &[(String, String)], form_fields: &[(String, String)], ) -> String
Generate a complete cache key from all Web CTE components
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if cache is enabled
Sourcepub fn set(
&mut self,
key: &str,
data: &[u8],
ttl_seconds: u64,
) -> Result<(), String>
pub fn set( &mut self, key: &str, data: &[u8], ttl_seconds: u64, ) -> Result<(), String>
Store data in cache with TTL
Sourcepub fn purge_all(&mut self) -> Result<usize, String>
pub fn purge_all(&mut self) -> Result<usize, String>
Check cache statistics Purge all cache entries (delete all keys matching sql-cli:* pattern)
pub fn stats(&mut self) -> Option<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedisCache
impl !RefUnwindSafe for RedisCache
impl Send for RedisCache
impl Sync for RedisCache
impl Unpin for RedisCache
impl !UnwindSafe for RedisCache
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