pub trait PoolFactory:
Send
+ Sync
+ 'static {
// Required methods
fn create<'a>(
&'a self,
config: &'a DatasourceConfig,
) -> CreatePoolFuture<'a>;
fn check<'a>(&'a self, handle: &'a DatasourceHandle) -> CheckFuture<'a>;
fn supported_schemes(&self) -> &[&str];
fn name(&self) -> &'static str;
// Provided methods
fn close<'a>(&'a self, _handle: &'a DatasourceHandle) -> CloseFuture<'a> { ... }
fn matches(&self, config: &DatasourceConfig) -> bool { ... }
}Required Methods§
fn create<'a>(&'a self, config: &'a DatasourceConfig) -> CreatePoolFuture<'a>
fn check<'a>(&'a self, handle: &'a DatasourceHandle) -> CheckFuture<'a>
fn supported_schemes(&self) -> &[&str]
fn name(&self) -> &'static str
Provided Methods§
Sourcefn close<'a>(&'a self, _handle: &'a DatasourceHandle) -> CloseFuture<'a>
fn close<'a>(&'a self, _handle: &'a DatasourceHandle) -> CloseFuture<'a>
Close a handle this factory created. The default is a no-op so providers without an explicit close keep compiling; providers that own pools (sqlx) override it so teardown drains their connections. Close MAY run more than once per handle and MUST stay safe to re-run (idempotent by contract).
fn matches(&self, config: &DatasourceConfig) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".