Skip to main content

LinkRx

Trait LinkRx 

Source
pub trait LinkRx: MaybeSend + 'static {
    type Error: Error + MaybeSend + MaybeSync + 'static;

    // Required method
    fn recv(
        &mut self,
    ) -> impl Future<Output = Result<Option<Backing>, Self::Error>> + MaybeSend + '_;
}
Expand description

Receiving half of a Link.

Yields Backing values: the raw bytes plus their ownership handle. The transport handles framing (length-prefix, WebSocket frames, etc.) and returns exactly one message’s bytes per recv call.

For SHM: the Backing might be a VarSlot reference. For TCP: the Backing is a heap-allocated buffer.

Required Associated Types§

Source

type Error: Error + MaybeSend + MaybeSync + 'static

Required Methods§

Source

fn recv( &mut self, ) -> impl Future<Output = Result<Option<Backing>, Self::Error>> + MaybeSend + '_

Receive the next message’s raw bytes.

Returns Ok(None) when the peer has closed the connection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§