hyperdriver::client::pool

Trait PoolableStream

Source
pub trait PoolableStream:
    Unpin
    + Send
    + Sized
    + 'static {
    // Required method
    fn can_share(&self) -> bool;
}
Available on crate feature 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§

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.

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§

Source§

impl PoolableStream for DuplexStream

Source§

impl PoolableStream for TcpStream

Source§

impl PoolableStream for UnixStream

Source§

impl PoolableStream for MockStream

Available on crate feature mocks only.
Source§

impl<IO> PoolableStream for Stream<IO>
where IO: HasConnectionInfo + Unpin + Send + 'static, IO::Addr: Send + Unpin + Clone,

Source§

impl<IO> PoolableStream for TlsStream<IO>
where IO: HasConnectionInfo + Unpin + Send + 'static, IO::Addr: Clone + Unpin + Send,

Available on crate feature tls only.
Source§

impl<Tls, NoTls> PoolableStream for TlsBraid<Tls, NoTls>
where Tls: TlsHandshakeStream + Send + Unpin + 'static, NoTls: AsyncRead + AsyncWrite + Send + Unpin + 'static,

Available on crate feature tls only.