h2::proto::peer

Trait Peer

Source
pub(crate) trait Peer {
    type Poll: Debug;

    const NAME: &'static str;

    // Required methods
    fn dyn() -> Dyn;
    fn convert_poll_message(
        pseudo: Pseudo,
        fields: HeaderMap,
        stream_id: StreamId,
    ) -> Result<Self::Poll, Error>;
}
Expand description

Either a Client or a Server

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Source

type Poll: Debug

Message type polled from the transport

Required Methods§

Source

fn dyn() -> Dyn

Source

fn convert_poll_message( pseudo: Pseudo, fields: HeaderMap, stream_id: StreamId, ) -> Result<Self::Poll, Error>

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 Peer for h2::client::Peer

Source§

const NAME: &'static str = "Client"

Source§

type Poll = Response<()>

Source§

impl Peer for h2::server::Peer

Source§

const NAME: &'static str = "Server"

Source§

type Poll = Request<()>