Function h2::server::handshake[][src]

pub fn handshake<T>(io: T) -> Handshake<T, Bytes>
Notable traits for Handshake<T, B>
impl<T, B: Buf> Future for Handshake<T, B> where
    T: AsyncRead + AsyncWrite + Unpin,
    B: Buf + 'static, 
type Output = Result<Connection<T, B>, Error>;
where
    T: AsyncRead + AsyncWrite + Unpin
Expand description

Creates a new configured HTTP/2.0 server with default configuration values backed by io.

It is expected that io already be in an appropriate state to commence the HTTP/2.0 handshake. See Handshake for more details.

Returns a future which resolves to the Connection instance once the HTTP/2.0 handshake has been completed. The returned Connection instance will be using default configuration values. Use Builder to customize the configuration values used by a Connection instance.

Examples

let connection = server::handshake(my_io).await.unwrap();
// The HTTP/2.0 handshake has completed, now use `connection` to
// accept inbound HTTP/2.0 streams.