mod impls;
mod pool;
use std::time::Duration;
pub use crate::{error::Error, metrics::PoolState, r#async::pool::InstrumentedPool};
#[async_trait::async_trait]
pub trait InstrumentablePool<'p> {
type Resource: 'p;
type Error: std::error::Error + Send + 'static;
async fn get(&'p self) -> Result<Self::Resource, Error<Self::Error>>;
fn try_get(&'p self) -> Result<Self::Resource, Error<Self::Error>> {
Err(Error::NotImplemented)
}
async fn get_timeout(
&'p self,
_timeout: Duration,
) -> Result<Self::Resource, Error<Self::Error>> {
Err(Error::NotImplemented)
}
fn get_state(&'p self) -> Result<PoolState, Error<Self::Error>> {
Err(Error::NotImplemented)
}
}