pub struct SharedAdapterResource { /* private fields */ }Expand description
Push B sibling of LegacyAdapterResource — wraps an
Arc<dyn DriverAdapter> but declares can_share()=true.
Used when an adapter has registered a
crate::adapter::SharedDriverRegistration opting it
into pool-shared semantics. The pool caches the
underlying Arc<dyn DriverAdapter> and hands the same
clone to every phase whose params produce the same
ResourceKey.
close() drops the wrapped adapter Arc — the actual
teardown timing is governed by the underlying
DriverAdapter’s Drop. Push D will add real async
close() to specific driver instances (e.g. awaiting
cass_session_close()’s CassFuture for the
cassandra-cpp engine).
Implementations§
pub fn new(key: ResourceKey, adapter: Arc<dyn DriverAdapter>) -> Self
pub fn adapter(&self) -> Option<Arc<dyn DriverAdapter>>
Trait Implementations§
Push B: this wrapper declares the adapter shareable.
The pool keeps one instance per ResourceKey and
returns the same Arc to every matching attach.
Source§fn accessor_payload(&self) -> Option<Arc<dyn Any + Send + Sync>>
fn accessor_payload(&self) -> Option<Arc<dyn Any + Send + Sync>>
SRD-104 — surface the wrapped adapter’s accessor payload (SRD-103’s
CQL session handle for the cql adapter). The pool captures this
right after init and hands clones to kernel nodes by fingerprint. The
pool-shared wrapper owns no payload itself; it delegates to the
adapter, which builds one over its connected session. None for
adapters that don’t opt in (the trait default).
Source§fn resource_key(&self) -> &ResourceKey
fn resource_key(&self) -> &ResourceKey
Source§fn close(self: Arc<Self>) -> ResourceFuture<'static, Result<(), String>>
fn close(self: Arc<Self>) -> ResourceFuture<'static, Result<(), String>>
Source§fn as_legacy_adapter(&self) -> Option<Arc<dyn DriverAdapter>>
fn as_legacy_adapter(&self) -> Option<Arc<dyn DriverAdapter>>
None; only LegacyAdapterResource
overrides it to surface its wrapped DriverAdapter
handle. Push B retires this entirely once each
adapter has its own SharedResource impl with no
hidden DriverAdapter inside. Read moreSource§fn can_support_more_load(&self) -> bool
fn can_support_more_load(&self) -> bool
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