Skip to main content

RedisAdminStore

Trait RedisAdminStore 

Source
pub trait RedisAdminStore: Send + Sync {
    // Required methods
    fn scan_match(&self, pattern: &str) -> Result<Vec<String>, StoreError>;
    fn pttl_ms(&self, key: &str) -> Result<i64, StoreError>;
    fn set_px(
        &self,
        key: &str,
        value: &str,
        ttl_ms: i64,
    ) -> Result<(), StoreError>;
    fn delete_keys(&self, keys: &[String]) -> Result<(), StoreError>;
    fn get_key(
        &self,
        prefix: &str,
        namespace: &str,
        key: &str,
    ) -> Result<Option<String>, StoreError>;
}
Expand description

The admin surface the legacy ban-key migration needs (the reference RedisAdmin, the sync seam pattern of crate::distributed).

Required Methods§

Source

fn scan_match(&self, pattern: &str) -> Result<Vec<String>, StoreError>

SCAN with MATCH pattern (the observable KEYS result).

§Errors

StoreError on a backend failure.

Source

fn pttl_ms(&self, key: &str) -> Result<i64, StoreError>

PTTL key in milliseconds: -1 persistent, -2 missing (the Redis semantics; the seconds/milliseconds distinction is normative).

§Errors

StoreError on a backend failure.

Source

fn set_px(&self, key: &str, value: &str, ttl_ms: i64) -> Result<(), StoreError>

SET key value PX ttl_ms: value and millisecond TTL land in one command (the migration’s write shape).

§Errors

StoreError on a backend failure.

Source

fn delete_keys(&self, keys: &[String]) -> Result<(), StoreError>

DEL keys....

§Errors

StoreError on a backend failure.

Source

fn get_key( &self, prefix: &str, namespace: &str, key: &str, ) -> Result<Option<String>, StoreError>

GET {prefix}{namespace}:{key} (the namespaced read the migration uses to carry the legacy value over). Ok(None) is a miss.

§Errors

StoreError on a backend failure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§