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ยง
Sourcefn recv_frame(&self) -> RecvResult<(Frame<V>, Callback<V>)>
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.
Sourcefn recv_frame_timeout(
&self,
timeout: Duration,
) -> RecvTimeoutResult<(Frame<V>, Callback<V>)>
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.
Sourcefn try_recv_frame(&self) -> TryRecvResult<(Frame<V>, Callback<V>)>
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.
Sourcefn frames(&self) -> impl Iterator<Item = (Frame<V>, Callback<V>)>
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.