pub struct RedisCache { /* private fields */ }Implementations§
Source§impl RedisCache
impl RedisCache
pub async fn connect(url: &str, prefix: &str) -> Result<Self>
pub async fn connect_with_name( url: &str, prefix: &str, connection_name: Option<&str>, ) -> Result<Self>
Sourcepub async fn connect_sentinel(
sentinel_urls: &[&str],
master_name: &str,
prefix: &str,
connection_name: Option<&str>,
) -> Result<Self>
pub async fn connect_sentinel( sentinel_urls: &[&str], master_name: &str, prefix: &str, connection_name: Option<&str>, ) -> Result<Self>
Connects to Redis via Sentinel, resolving the current master.
Uses Sentinel::async_master_for() to discover the master address,
then creates a standard ConnectionManager from the resolved Client.
Trait Implementations§
Source§impl Cache for RedisCache
impl Cache for RedisCache
fn set_nx_px( &self, key: &[u8], value: &[u8], ttl: Duration, ) -> impl Future<Output = Result<bool>> + Send
fn set( &self, key: &[u8], value: &[u8], ttl: Duration, ) -> impl Future<Output = Result<()>> + Send
fn get( &self, key: &[u8], ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send
fn del(&self, key: &[u8]) -> impl Future<Output = Result<()>> + Send
Source§impl Clone for RedisCache
impl Clone for RedisCache
Source§fn clone(&self) -> RedisCache
fn clone(&self) -> RedisCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RedisCache
impl !RefUnwindSafe for RedisCache
impl Send for RedisCache
impl Sync for RedisCache
impl Unpin for RedisCache
impl UnsafeUnpin 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