Trait hyperdriver::client::pool::PoolableTransport

source ·
pub trait PoolableTransport: Unpin + Send + Sized + 'static {
    // Required method
    fn can_share(&self) -> bool;
}
Available on crate feature client only.
Expand description

A crate::client::conn::Transport 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§

source

fn can_share(&self) -> bool

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl PoolableTransport for MockTransport

Available on crate feature mocks only.
source§

impl<IO> PoolableTransport for TransportStream<IO>
where IO: HasConnectionInfo + Unpin + Send + 'static, IO::Addr: Send,