pub struct RedisPool { /* private fields */ }Expand description
Redis connection wrapper
Implementations§
Source§impl RedisPool
impl RedisPool
Sourcepub fn get_connection(&self) -> Arc<ConnectionManager>
pub fn get_connection(&self) -> Arc<ConnectionManager>
Get a connection for async operations Note: ConnectionManager is already cloneable, so we can use it directly
Sourcepub async fn increment_with_expiry(
&self,
key: &str,
expiry_seconds: u64,
) -> Result<i64>
pub async fn increment_with_expiry( &self, key: &str, expiry_seconds: u64, ) -> Result<i64>
Increment a counter with expiration Returns the new count after increment
Sourcepub async fn get_counter(&self, key: &str) -> Result<i64>
pub async fn get_counter(&self, key: &str) -> Result<i64>
Get a counter value
Sourcepub async fn set_with_expiry(
&self,
key: &str,
value: &str,
expiry_seconds: u64,
) -> Result<()>
pub async fn set_with_expiry( &self, key: &str, value: &str, expiry_seconds: u64, ) -> Result<()>
Set a key with expiration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedisPool
impl !RefUnwindSafe for RedisPool
impl Send for RedisPool
impl Sync for RedisPool
impl Unpin for RedisPool
impl UnsafeUnpin for RedisPool
impl !UnwindSafe for RedisPool
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.