#![allow(dead_code)]
#![allow(clippy::mismatched_lifetime_syntaxes)]
use crate::db::DatabaseConfig;
use crate::error::Result;
pub struct Pool {
config: DatabaseConfig,
size: u32,
}
impl Pool {
pub fn new(config: DatabaseConfig) -> Self {
let size = config.max_connections;
Self { config, size }
}
pub fn size(&self) -> u32 {
self.size
}
pub fn config(&self) -> &DatabaseConfig {
&self.config
}
pub async fn acquire(&self) -> Result<PoolConnection<'_>> {
Ok(PoolConnection { pool: self })
}
}
pub struct PoolConnection<'a> {
pool: &'a Pool,
}
impl<'a> PoolConnection<'a> {
pub fn release(self) {
}
}