ReceiveFrame

Trait ReceiveFrame 

Source
pub trait ReceiveFrame<V: MaybeVersioned>: ReceiveEvent<V> {
    // Provided methods
    fn recv_frame(&self) -> RecvResult<(Frame<V>, Callback<V>)> { ... }
    fn recv_frame_timeout(
        &self,
        timeout: Duration,
    ) -> RecvTimeoutResult<(Frame<V>, Callback<V>)> { ... }
    fn try_recv_frame(&self) -> TryRecvResult<(Frame<V>, Callback<V>)> { ... }
    fn frames(&self) -> impl Iterator<Item = (Frame<V>, Callback<V>)> { ... }
}
Expand description

๐Ÿ”’ Synchronous API for receiving valid MAVLink frames.

๐Ÿ”’ This trait is sealed ๐Ÿ”’

Provided Methodsยง

Source

fn recv_frame(&self) -> RecvResult<(Frame<V>, Callback<V>)>

sync Receives the next frame. Blocks until valid frame received or channel is closed.

If you want to block until the next frame within a timeout, use recv_frame_timeout. If you want to check for the next frame without blocking, use try_recv_frame.

โš  This method skips all invalid frames. If you are interested in such frames, use events or recv instead to receive Event::Invalid event that contain invalid frame with the corresponding error.

Source

fn recv_frame_timeout( &self, timeout: Duration, ) -> RecvTimeoutResult<(Frame<V>, Callback<V>)>

sync Attempts ot receives the next frame until the timeout is reached. Blocks until valid frame received, deadline is reached, or channel is closed.

If you want to block until the next frame is received, use recv_frame. If you want to check for the next frame without blocking, use try_recv_frame.

โš  This method skips all invalid frames. If you are interested in such frames, use events or recv_timeout instead to receive Event::Invalid event that contains invalid frame with the corresponding error.

Source

fn try_recv_frame(&self) -> TryRecvResult<(Frame<V>, Callback<V>)>

sync Attempts to receive the next valid frame. Returns immediately if channel is empty.

If you want to block until the next frame within a timeout, use recv_frame_timeout. If you want to block until the next frame is received, use recv_frame.

โš  This method skips all invalid frames. If you are interested in such frames, use events or try_recv instead to receive Event::Invalid event that contains invalid frame with the corresponding error.

Source

fn frames(&self) -> impl Iterator<Item = (Frame<V>, Callback<V>)>

sync Subscribes to valid MAVLink frames.

Blocks while the underlying node is active.

โš  This method skips all invalid frames. If you are interested in such frames, use events, recv, recv_timeout, or try_recv instead to receive Event::Invalid event that contains invalid frame with the corresponding error.

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ยง