1#![allow(async_fn_in_trait)]
2
3#[macro_use]
4mod defer;
5pub mod duration;
6pub mod guard;
7pub mod plugin;
8pub mod pool;
9pub mod state;
10
11pub trait Manager: std::any::Any + Send + Sync {
13 type Connection: Send;
14
15 type Error: for<'a> From<&'a str>;
16
17 async fn connect(&self) -> Result<Self::Connection, Self::Error>;
19
20 async fn check(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>;
22}
23
24pub use guard::ConnectionGuard;
25pub use pool::Pool;
26pub use state::State;