pub trait DatabaseDriverFactory:
Send
+ Sync
+ 'static {
// Required methods
fn create(&self) -> Arc<dyn DatabaseDriver> ⓘ;
fn driver_id(&self) -> &'static str;
// Provided methods
fn protocol_version(&self) -> u32 { ... }
fn supports_cancel_query(&self) -> bool { ... }
fn supports_explain(&self) -> bool { ... }
fn supports_streaming_results(&self) -> bool { ... }
fn create_kv(&self) -> Option<Arc<dyn KeyValueDriver>> { ... }
}Expand description
Factory that plugins implement to register their driver.
Use the [register_driver!] macro for convenient registration.
Required Methods§
Sourcefn create(&self) -> Arc<dyn DatabaseDriver> ⓘ
fn create(&self) -> Arc<dyn DatabaseDriver> ⓘ
Create an instance of the driver.
Provided Methods§
Sourcefn protocol_version(&self) -> u32
fn protocol_version(&self) -> u32
Protocol version this plugin was compiled against.
Sourcefn supports_cancel_query(&self) -> bool
fn supports_cancel_query(&self) -> bool
Whether this driver supports query cancellation.
Sourcefn supports_explain(&self) -> bool
fn supports_explain(&self) -> bool
Whether this driver supports EXPLAIN analysis.
Sourcefn supports_streaming_results(&self) -> bool
fn supports_streaming_results(&self) -> bool
Whether this driver supports streaming results.
Sourcefn create_kv(&self) -> Option<Arc<dyn KeyValueDriver>>
fn create_kv(&self) -> Option<Arc<dyn KeyValueDriver>>
If this driver also implements KeyValueDriver, return it. Default returns None.
Trait Implementations§
impl Collect for &'static dyn DatabaseDriverFactory
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".