LaneRxBorrow

Trait LaneRxBorrow 

Source
pub trait LaneRxBorrow {
    // Required method
    fn recv_with<F, R>(&mut self, f: F) -> Result<Option<R>, LaneRxError>
       where F: FnOnce(&[u8]) -> R;
}
Expand description

RX side of a lane, borrowed receive.

This enables adapters to parse/decode without copying bytes into an intermediate buffer.

The borrowed &[u8] passed to the callback is only valid for the duration of the callback.

Required Methods§

Source

fn recv_with<F, R>(&mut self, f: F) -> Result<Option<R>, LaneRxError>
where F: FnOnce(&[u8]) -> R,

Receive one message and pass it to f by borrowed slice.

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§