pub struct DriverImpl {
pub adapter: &'static str,
pub driver: &'static str,
pub default_rank: u32,
pub create: fn(HashMap<String, String>) -> CreateAdapterFuture,
pub known_params: fn() -> &'static [&'static str],
}Expand description
One driver implementation registered for an adapter.
Each driver contributes a DriverImpl to the inventory.
At session start the runner picks one — by user override
(e.g. cqldriver=scylla) or by default ranking — and calls
its create factory. The resulting DriverAdapter wears
the adapter’s name (e.g. "cql"), not the driver’s; the
driver name is internal and never appears in op-level
adapter: fields.
// In a driver module under nmbrs-adapter-cql:
inventory::submit! {
nmbrs_runtime::adapter::DriverImpl {
adapter: "cql",
driver: "scylla",
default_rank: 200,
create: |params| Box::pin(async move { ... }),
known_params: || &["hosts", "port", ...],
}
}Fields§
§adapter: &'static strThe adapter this driver implements (e.g. "cql").
Matches the AdapterRegistration::names of the
adapter the user selects with adapter=….
driver: &'static strThe driver identifier. Surfaces in
<adapter>driver=<driver> for user-facing selection
(e.g. cqldriver=scylla). Internal — never appears as
a top-level adapter name.
default_rank: u32Lower wins when no user override is given. Drivers pick their own rank — convention is to space ranks by 100s so future drivers can slot between them.
create: fn(HashMap<String, String>) -> CreateAdapterFutureAsync factory for this driver. Same shape as
AdapterRegistration::create — given workload params,
connect and return a boxed DriverAdapter whose
DriverAdapter::name is the adapter name.
known_params: fn() -> &'static [&'static str]Driver-specific param names — unioned into the adapter’s known-params surface for CLI validation.
Trait Implementations§
impl Collect for DriverImpl
Auto Trait Implementations§
impl Freeze for DriverImpl
impl RefUnwindSafe for DriverImpl
impl Send for DriverImpl
impl Sync for DriverImpl
impl Unpin for DriverImpl
impl UnsafeUnpin for DriverImpl
impl UnwindSafe for DriverImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more