pub trait Connection {
    // Required methods
    fn id(&self) -> u64;
    fn poll_open_bidirectional_stream(
        &mut self,
        id: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>>;
    fn poll_open_send_stream(
        &mut self,
        id: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>>;
    fn poll_accept_stream(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<Option<u64>>>;
    fn poll_send(
        &mut self,
        owner: Owner,
        id: u64,
        bytes: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<u64>>;
    fn poll_receive(
        &mut self,
        owner: Owner,
        id: u64,
        bytes: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<u64>>;
    fn poll_send_finish(
        &mut self,
        owner: Owner,
        id: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>>;
    fn poll_receive_finish(
        &mut self,
        owner: Owner,
        id: u64,
        cx: &mut Context<'_>
    ) -> Poll<Result<()>>;

    // Provided methods
    fn poll_progress(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>> { ... }
    fn poll_finish(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>> { ... }
}

Required Methods§

source

fn id(&self) -> u64

source

fn poll_open_bidirectional_stream( &mut self, id: u64, cx: &mut Context<'_> ) -> Poll<Result<()>>

source

fn poll_open_send_stream( &mut self, id: u64, cx: &mut Context<'_> ) -> Poll<Result<()>>

source

fn poll_accept_stream( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Option<u64>>>

source

fn poll_send( &mut self, owner: Owner, id: u64, bytes: u64, cx: &mut Context<'_> ) -> Poll<Result<u64>>

source

fn poll_receive( &mut self, owner: Owner, id: u64, bytes: u64, cx: &mut Context<'_> ) -> Poll<Result<u64>>

source

fn poll_send_finish( &mut self, owner: Owner, id: u64, cx: &mut Context<'_> ) -> Poll<Result<()>>

source

fn poll_receive_finish( &mut self, owner: Owner, id: u64, cx: &mut Context<'_> ) -> Poll<Result<()>>

Provided Methods§

source

fn poll_progress(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

source

fn poll_finish(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>

Implementors§

source§

impl<T: AsyncRead + AsyncWrite> Connection for s2n_netbench::duplex::Connection<T>

source§

impl<T: AsyncRead + AsyncWrite> Connection for s2n_netbench::multiplex::Connection<T>