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<()>> { ... }
}