pub struct SharedDriverRegistration {
pub adapter: &'static str,
pub driver: &'static str,
pub share_capability: ShareCapability,
pub resource_key: fn(&HashMap<String, String>) -> Result<ResourceKey, String>,
}Expand description
SRD-35 Push B: declares that a (adapter, driver) pair
supports pool-shared instances. Drivers that submit one
of these opt into the resource pool’s Shared policy
path: instead of a fresh Arc<dyn DriverAdapter> per
phase, the pool caches the adapter under
Self::resource_key and reuses it across every phase
whose params produce the same key.
Drivers without a SharedDriverRegistration continue
to use Push A’s LegacyAdapterResource shim, which is
PerPhase-isolated. Migration is opt-in per driver.
Fields§
§adapter: &'static strAdapter name this registration applies to (e.g.
"cql"). Pairs with Self::driver for lookup.
driver: &'static strDriver identifier (e.g. "cassandra-cpp",
"scylla"). Distinguishes registrations when the
same adapter has multiple driver implementations.
Strongest sharing the driver supports. Default
Shared for typical pool-friendly drivers; stricter
only if the driver type can’t be safely shared.
resource_key: fn(&HashMap<String, String>) -> Result<ResourceKey, String>Pure function that derives the resource key from
the adapter’s params. Two phases with the same key
share an instance under Shared policy. SRD-35
§“Instance-shaping vs shell-shaping params” — only
instance-shaping params (hosts, keyspace, …)
belong here; per-statement and per-phase knobs MUST
NOT.
Trait Implementations§
Auto Trait Implementations§
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