Skip to main content

AsyncMavConnection

Trait AsyncMavConnection 

Source
pub trait AsyncMavConnection<M: Sync + Send>: Send + Sync {
Show 13 methods // Required methods fn recv( &self, ) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send; fn recv_raw( &self, ) -> impl Future<Output = Result<MAVLinkMessageRaw, MessageReadError>> + Send; fn try_recv( &self, ) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send; fn send( &self, header: &MavHeader, data: &M, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send; fn send_raw( &self, data: &MAVLinkMessageRaw, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send; fn set_protocol_version(&mut self, version: MavlinkVersion); fn protocol_version(&self) -> MavlinkVersion; fn set_allow_recv_any_version(&mut self, allow: bool); fn allow_recv_any_version(&self) -> bool; fn setup_signing(&mut self, signing_data: Option<SigningConfig>); // Provided methods fn send_frame( &self, frame: &MavFrame<M>, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send where M: Message { ... } fn recv_frame( &self, ) -> impl Future<Output = Result<MavFrame<M>, MessageReadError>> + Send where M: Message { ... } fn send_default( &self, data: &M, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send { ... }
}
Available on crate feature tokio and (crate features std or tokio) only.
Expand description

An async MAVLink connection

Required Methods§

Source

fn recv( &self, ) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send

Receive a mavlink message.

Yield until a valid frame is received, ignoring invalid messages.

Source

fn recv_raw( &self, ) -> impl Future<Output = Result<MAVLinkMessageRaw, MessageReadError>> + Send

Receive a raw, unparsed mavlink message.

Yield until a valid frame is received, ignoring invalid messages.

Source

fn try_recv( &self, ) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send

Receive a MAVLink message without retrying read or parse errors.

Waits for the reader lock and incoming data.

Source

fn send( &self, header: &MavHeader, data: &M, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send

Send a mavlink message

Source

fn send_raw( &self, data: &MAVLinkMessageRaw, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send

Send a raw, unparsed mavlink message

Source

fn set_protocol_version(&mut self, version: MavlinkVersion)

Sets the MAVLink version to use for receiving (when allow_recv_any_version() is false) and sending messages.

Source

fn protocol_version(&self) -> MavlinkVersion

Gets the currently used MAVLink version

Source

fn set_allow_recv_any_version(&mut self, allow: bool)

Set wether MAVLink messages of either version may be received.

If set to false only messages of the version configured with set_protocol_version() are received.

Source

fn allow_recv_any_version(&self) -> bool

Wether messages of any MAVLink version may be received.

Source

fn setup_signing(&mut self, signing_data: Option<SigningConfig>)

Available on crate feature mav2-message-signing only.

Setup secret key used for message signing, or disable message signing.

Provided Methods§

Source

fn send_frame( &self, frame: &MavFrame<M>, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
where M: Message,

Write whole frame.

Source

fn recv_frame( &self, ) -> impl Future<Output = Result<MavFrame<M>, MessageReadError>> + Send
where M: Message,

Read whole frame.

Source

fn send_default( &self, data: &M, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send

Send a message with default header.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§