Skip to main content

PoolConnection

Trait PoolConnection 

Source
pub trait PoolConnection {
    // Required methods
    fn is_closed(&self) -> bool;
    fn can_open_stream(&self) -> bool;
    fn request(
        &self,
        init: RequestInit,
    ) -> LocalBoxFuture<'static, Result<Response, H2Error>>;
    fn close(&self);
}
Expand description

A connection a H2Pool can route over. Implemented for H2Connection; tests supply their own.

Required Methods§

Source

fn is_closed(&self) -> bool

Whether the connection has been torn down.

Source

fn can_open_stream(&self) -> bool

Whether a new request would stay within the peer’s advertised SETTINGS_MAX_CONCURRENT_STREAMS.

Source

fn request( &self, init: RequestInit, ) -> LocalBoxFuture<'static, Result<Response, H2Error>>

Issue a request on this connection.

Source

fn close(&self)

Gracefully close the connection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§