Trait FDomainTransport

Source
pub trait FDomainTransport: StreamTrait<Item = Result<Box<[u8]>, Error>> + Send {
    // Required method
    fn poll_send_message(
        self: Pin<&mut Self>,
        msg: &[u8],
        ctx: &mut Context<'_>,
    ) -> Poll<Result<(), Error>>;
}
Expand description

Implemented by objects which provide a transport over which we can speak the FDomain protocol.

The implementer must provide two things:

  1. An incoming stream of messages presented as Vec<u8>. This is provided via the Stream trait, which this trait requires.
  2. A way to send messages. This is provided by implementing the poll_send_message method.

Required Methods§

Source

fn poll_send_message( self: Pin<&mut Self>, msg: &[u8], ctx: &mut Context<'_>, ) -> Poll<Result<(), Error>>

Attempt to send a message asynchronously. Messages should be sent so that they arrive at the target in order.

Implementors§