Trait fibers_transport::Transport[][src]

pub trait Transport {
    type PeerAddr: PeerAddr;
    type SendItem;
    type RecvItem;
    fn start_send(
        &mut self,
        peer: Self::PeerAddr,
        item: Self::SendItem
    ) -> Result<()>;
fn poll_send(&mut self) -> PollSend;
fn poll_recv(&mut self) -> PollRecv<(Self::PeerAddr, Self::RecvItem)>; }

This trait allows for sending and receiving items between peers.

Associated Types

Peer address.

Outgoing item.

Incoming item.

Required Methods

Starts sending the given item to the destination peer.

Polls the transmission of the all outstanding items in the transporter have been completed.

If it has been completed, this will return Ok(Async::Ready(())).

Polls reception of an item from a peer.

If the transporter has terminated, this will return Ok(Async::Ready(None)).

Implementors