pub struct Pool { /* private fields */ }Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(config: RedisConfig) -> Self
pub fn new(config: RedisConfig) -> Self
Create a pool. Nothing is connected until the first command, so an application still boots when Redis is briefly unavailable — a cache being down should degrade a service, not stop it starting.
pub fn config(&self) -> &RedisConfig
Sourcepub async fn verify(&self) -> Result<()>
pub async fn verify(&self) -> Result<()>
Open one connection immediately, so a misconfiguration is reported at boot rather than on the first cache miss in production.
pub async fn acquire(&self) -> Result<PooledConnection>
Sourcepub async fn command(&self, args: &[&[u8]]) -> Result<Value>
pub async fn command(&self, args: &[&[u8]]) -> Result<Value>
Run one command on a borrowed connection.
Sourcepub async fn idle_count(&self) -> usize
pub async fn idle_count(&self) -> usize
How many connections are idle. For tests and diagnostics.
pub async fn close(&self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Pool
impl !UnwindSafe for Pool
impl Freeze for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
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