Registry / database / bb8
library0.9.1rscratesunverified

Full-featured async (tokio-based) connection pool (like r2d2)

# Cargo.toml [dependencies] bb8 = "0.9.1"
INSTALL
IMPORT
SIG · BB8
B
bb8
databaserustv0.9.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Pool
use bb8::Pool;

Create and use a connection pool

use bb8::Pool; use bb8::ManageConnection; struct MyManager; #[async_trait::async_trait] impl ManageConnection for MyManager { type Connection = String; type Error = std::io::Error; async fn connect(&self) -> Result<Self::Connection, Self::Error> { Ok("connected".to_string()) } async fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Error> { Ok(()) } fn has_broken(&self, _conn: &mut Self::Connection) -> bool { false } } #[tokio::main] async fn main() { let pool = Pool::builder().max_size(10).build(MyManager).await.unwrap(); let conn = pool.get().await.unwrap(); println!("{}", conn); }
Debug
Known issues
gotchaRequires a Tokio runtime; not compatible with other async runtimes.
fix
Use tokio::main or ensure a Tokio runtime is active.
affects: >=0.9.0
Upgrade
Version history
0.9.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
bb8 — cargo add bb8 · libregistry