pub struct RedisConnection { /* private fields */ }Expand description
Represents a Redis connection (placeholder for actual implementation).
Not yet implemented: no Redis client is compiled in. Construction via
RedisConnection::new fails, and every command returns
CacheError::Backend. A real implementation would use the redis-rs
or fred crate.
Implementations§
Source§impl RedisConnection
impl RedisConnection
Sourcepub async fn new(config: RedisCacheConfig) -> CacheResult<Self>
pub async fn new(config: RedisCacheConfig) -> CacheResult<Self>
Create a new connection.
Not yet implemented: always returns CacheError::Backend —
no Redis client is compiled in. A real implementation would create a
connection pool (bb8/deadpool), establish initial connections, and
verify connectivity.
Sourcepub fn config(&self) -> &RedisCacheConfig
pub fn config(&self) -> &RedisCacheConfig
Get the config.
Sourcepub async fn get(&self, key: &str) -> CacheResult<Option<Vec<u8>>>
pub async fn get(&self, key: &str) -> CacheResult<Option<Vec<u8>>>
GET command (not implemented — always errors).
Sourcepub async fn set(
&self,
key: &str,
value: &[u8],
ttl: Option<Duration>,
) -> CacheResult<()>
pub async fn set( &self, key: &str, value: &[u8], ttl: Option<Duration>, ) -> CacheResult<()>
SET command with optional TTL (not implemented — always errors).
Sourcepub async fn del(&self, key: &str) -> CacheResult<bool>
pub async fn del(&self, key: &str) -> CacheResult<bool>
DEL command (not implemented — always errors).
Sourcepub async fn exists(&self, key: &str) -> CacheResult<bool>
pub async fn exists(&self, key: &str) -> CacheResult<bool>
EXISTS command (not implemented — always errors).
Sourcepub async fn keys(&self, pattern: &str) -> CacheResult<Vec<String>>
pub async fn keys(&self, pattern: &str) -> CacheResult<Vec<String>>
KEYS command (not implemented — always errors; a real impl would use SCAN in production).
Sourcepub async fn mget(&self, keys: &[String]) -> CacheResult<Vec<Option<Vec<u8>>>>
pub async fn mget(&self, keys: &[String]) -> CacheResult<Vec<Option<Vec<u8>>>>
MGET command (not implemented — always errors).
Sourcepub async fn mset(&self, pairs: &[(String, Vec<u8>)]) -> CacheResult<()>
pub async fn mset(&self, pairs: &[(String, Vec<u8>)]) -> CacheResult<()>
MSET command (not implemented — always errors).
Sourcepub async fn flush(&self) -> CacheResult<()>
pub async fn flush(&self) -> CacheResult<()>
FLUSHDB command (not implemented — always errors).
Sourcepub async fn dbsize(&self) -> CacheResult<usize>
pub async fn dbsize(&self) -> CacheResult<usize>
DBSIZE command (not implemented — always errors).
Sourcepub async fn info(&self) -> CacheResult<String>
pub async fn info(&self) -> CacheResult<String>
INFO command (not implemented — always errors).
Trait Implementations§
Source§impl Clone for RedisConnection
impl Clone for RedisConnection
Source§fn clone(&self) -> RedisConnection
fn clone(&self) -> RedisConnection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more