pub trait Driver:
Send
+ Sync
+ 'static {
// Required methods
fn dialect(&self) -> Arc<dyn Dialect> ⓘ;
fn connect(&self) -> BoxFuture<'_, Result<Box<dyn DriverConnection>>>;
fn describe(&self) -> String;
// Provided methods
fn max_connections(&self) -> usize { ... }
fn generation(&self) -> u64 { ... }
}Expand description
Opens connections, and knows what dialect they speak.
Required Methods§
fn dialect(&self) -> Arc<dyn Dialect> ⓘ
fn connect(&self) -> BoxFuture<'_, Result<Box<dyn DriverConnection>>>
Provided Methods§
Sourcefn max_connections(&self) -> usize
fn max_connections(&self) -> usize
How many connections the pool should allow at once.
Sourcefn generation(&self) -> u64
fn generation(&self) -> u64
Which generation of credentials a connection opened now would belong to.
Zero when the driver’s credentials never change, which is the common case and the one that costs nothing: the pool compares the number it stored against this, and zero always equals zero.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".