Skip to main content

FDomainTransport

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<(), Option<Error>>>;

    // Provided methods
    fn debug_fmt(&self, _: &mut Formatter<'_>) -> Result { ... }
    fn has_debug_fmt(&self) -> bool { ... }
}
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<(), Option<Error>>>

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

Provided Methods§

Source

fn debug_fmt(&self, _: &mut Formatter<'_>) -> Result

Optional debug information outlet.

Source

fn has_debug_fmt(&self) -> bool

Whether debug_fmt does anything.

Implementors§