pub trait Messagewhere
Self: Sized,{
// Required methods
fn message_id(&self) -> u32;
fn message_name(&self) -> &'static str;
fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize;
fn parse(
version: MavlinkVersion,
msgid: u32,
payload: &[u8],
) -> Result<Self, ParserError>;
fn message_id_from_name(name: &str) -> Result<u32, &'static str>;
fn default_message_from_id(id: u32) -> Result<Self, &'static str>;
fn extra_crc(id: u32) -> u8;
}
Required Methods§
fn message_id(&self) -> u32
fn message_name(&self) -> &'static str
Sourcefn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize
fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize
Serialize Message into byte slice and return count of bytes written
fn parse( version: MavlinkVersion, msgid: u32, payload: &[u8], ) -> Result<Self, ParserError>
fn message_id_from_name(name: &str) -> Result<u32, &'static str>
fn default_message_from_id(id: u32) -> Result<Self, &'static str>
fn extra_crc(id: u32) -> u8
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.