pub trait Exchange<M: Manage>:
Send
+ Sync
+ 'static {
// Required methods
fn park(&self, conn: M::Connection, meta: SlotMeta) -> Parked<M>;
fn unpark(&self) -> impl Future<Output = Unparked<M>>;
fn parked(&self) -> u64;
// Provided method
fn clear(&self) { ... }
}Expand description
Strategy for moving idle connections between per-thread shards.
Required Methods§
Sourcefn park(&self, conn: M::Connection, meta: SlotMeta) -> Parked<M>
fn park(&self, conn: M::Connection, meta: SlotMeta) -> Parked<M>
Offers an idle connection to other threads. Must not block.
Provided Methods§
Sourcefn clear(&self)
fn clear(&self)
Drops every parked connection. Called by Pool::close.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".