pub trait PoolableConnection:
Unpin
+ Send
+ Sized
+ 'static {
// Required methods
fn is_open(&self) -> bool;
fn can_share(&self) -> bool;
fn reuse(&mut self) -> Option<Self>;
}Available on crate feature
client only.Expand description
A crate::client::conn::Connection that can be pooled.
These connections must report to the pool whether they remain open, and whether they can be shared / multiplexed.
The pool will call PoolableConnection::reuse to get a new connection
to return to the pool, which will multiplex against this one. If multiplexing
is not possible, then None should be returned.
Required Methods§
Returns true if the connection can be shared / multiplexed.
If this returns true, then PoolableConnection::reuse will be called to get
a new connection to return to the pool.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl PoolableConnection for MockSender
Available on crate feature
mocks only.