pub trait AsyncMavConnection<M>: 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 { ... }
}tokio only.Expand description
An async MAVLink connection
Required Methods§
Sourcefn recv(
&self,
) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send
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.
Sourcefn recv_raw(
&self,
) -> impl Future<Output = Result<MAVLinkMessageRaw, MessageReadError>> + Send
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.
Sourcefn try_recv(
&self,
) -> impl Future<Output = Result<(MavHeader, M), MessageReadError>> + Send
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.
Sourcefn send(
&self,
header: &MavHeader,
data: &M,
) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
fn send( &self, header: &MavHeader, data: &M, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
Send a mavlink message
Sourcefn send_raw(
&self,
data: &MAVLinkMessageRaw,
) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
fn send_raw( &self, data: &MAVLinkMessageRaw, ) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
Send a raw, unparsed mavlink message
Sourcefn set_protocol_version(&mut self, version: MavlinkVersion)
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.
Sourcefn protocol_version(&self) -> MavlinkVersion
fn protocol_version(&self) -> MavlinkVersion
Gets the currently used MAVLink version
Sourcefn set_allow_recv_any_version(&mut self, allow: bool)
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.
Sourcefn allow_recv_any_version(&self) -> bool
fn allow_recv_any_version(&self) -> bool
Wether messages of any MAVLink version may be received.
Sourcefn setup_signing(&mut self, signing_data: Option<SigningConfig>)
Available on crate feature mav2-message-signing only.
fn setup_signing(&mut self, signing_data: Option<SigningConfig>)
mav2-message-signing only.Setup secret key used for message signing, or disable message signing.
Provided Methods§
Sourcefn send_frame(
&self,
frame: &MavFrame<M>,
) -> impl Future<Output = Result<usize, MessageWriteError>> + Sendwhere
M: Message,
fn send_frame(
&self,
frame: &MavFrame<M>,
) -> impl Future<Output = Result<usize, MessageWriteError>> + Sendwhere
M: Message,
Write whole frame.
Sourcefn recv_frame(
&self,
) -> impl Future<Output = Result<MavFrame<M>, MessageReadError>> + Sendwhere
M: Message,
fn recv_frame(
&self,
) -> impl Future<Output = Result<MavFrame<M>, MessageReadError>> + Sendwhere
M: Message,
Read whole frame.
Sourcefn send_default(
&self,
data: &M,
) -> impl Future<Output = Result<usize, MessageWriteError>> + Send
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".