Trait RedisAsyncClientTrait

Source
pub trait RedisAsyncClientTrait<TSelf> {
Show 14 methods // Required methods async fn new(url: Option<String>, namespace: Namespace) -> Result<TSelf>; async fn set_eviction_policy( &self, eviction_policy: EvictionPolicy, ) -> Result<String>; async fn get_eviction_policy(&self) -> Result<String>; fn key(&self, prefix: &Prefix, key: &Key) -> String; async fn get(&self, key: &str) -> Result<Option<String>>; async fn set_ex( &self, key: &str, value: &str, expiry: Option<u64>, ) -> Result<()>; async fn get_all(&self) -> Result<Vec<(String, String)>>; async fn remove(&self, key: Vec<String>) -> Result<()>; async fn scan<T>( &self, pattern: &str, chunk_size: Option<usize>, limit: Option<usize>, ) -> Result<Vec<T>> where T: DeserializeOwned + Serialize; // Provided methods async fn get_entity<T>( &self, prefix: &Prefix, key: &Key, ) -> Result<Option<T>> where T: DeserializeOwned + Serialize { ... } async fn save_entity<T>( &self, prefix: &Prefix, key: &Key, value: &T, expiry: Option<u64>, ) -> Result<()> where T: DeserializeOwned + Serialize { ... } async fn remove_entity<T>(&self, prefix: &Prefix, key: &Key) -> Result<()> { ... } fn des_entity<E>(redis_str: &str) -> Result<E> where E: DeserializeOwned + Serialize { ... } fn ser_entity<E>(entity: &E) -> Result<String> where E: DeserializeOwned + Serialize { ... }
}

Required Methods§

Source

async fn new(url: Option<String>, namespace: Namespace) -> Result<TSelf>

Source

async fn set_eviction_policy( &self, eviction_policy: EvictionPolicy, ) -> Result<String>

Source

async fn get_eviction_policy(&self) -> Result<String>

Source

fn key(&self, prefix: &Prefix, key: &Key) -> String

Source

async fn get(&self, key: &str) -> Result<Option<String>>

Source

async fn set_ex( &self, key: &str, value: &str, expiry: Option<u64>, ) -> Result<()>

Source

async fn get_all(&self) -> Result<Vec<(String, String)>>

Source

async fn remove(&self, key: Vec<String>) -> Result<()>

Source

async fn scan<T>( &self, pattern: &str, chunk_size: Option<usize>, limit: Option<usize>, ) -> Result<Vec<T>>

Provided Methods§

Source

async fn get_entity<T>(&self, prefix: &Prefix, key: &Key) -> Result<Option<T>>

Source

async fn save_entity<T>( &self, prefix: &Prefix, key: &Key, value: &T, expiry: Option<u64>, ) -> Result<()>

Source

async fn remove_entity<T>(&self, prefix: &Prefix, key: &Key) -> Result<()>

Source

fn des_entity<E>(redis_str: &str) -> Result<E>

Source

fn ser_entity<E>(entity: &E) -> Result<String>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§