pub trait PoolableStream:
Unpin
+ Send
+ Sized
+ 'static {
// Required method
fn can_share(&self) -> bool;
}client only.Expand description
A crate::client::conn::Transport Stream that can produce connections
which might be poolable.
This trait is used by the pool connection checkout process before the handshake occurs to check if the connection has negotiated or upgraded to a protocol which enables multiplexing. This is an optimistic check, and the connection will be checked again after the handshake is complete.
Required Methods§
Returns true if the transport can be re-used, usually
because it has used ALPN to negotiate a protocol that can
be multiplexed.
This is effectively speculative, so should only return true
when we are sure that the connection on this transport
will be able to multiplex.
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 PoolableStream for DuplexStream
impl PoolableStream for TcpStream
impl PoolableStream for UnixStream
impl PoolableStream for MockStream
mocks only.impl<IO> PoolableStream for Stream<IO>
impl<IO> PoolableStream for TlsStream<IO>
tls only.impl<Tls, NoTls> PoolableStream for TlsBraid<Tls, NoTls>where
Tls: TlsHandshakeStream + Send + Unpin + 'static,
NoTls: AsyncRead + AsyncWrite + Send + Unpin + 'static,
tls only.