pub trait MessageData: Sized {
type Message: Message;
const ID: u32;
const NAME: &'static str;
const EXTRA_CRC: u8;
const ENCODED_LEN: usize;
// Required methods
fn ser(&self, version: MavlinkVersion, payload: &mut [u8]) -> usize;
fn deser(
version: MavlinkVersion,
payload: &[u8],
) -> Result<Self, ParserError>;
}Required Associated Constants§
const ID: u32
const NAME: &'static str
const EXTRA_CRC: u8
const ENCODED_LEN: usize
Required Associated Types§
Required Methods§
Sourcefn ser(&self, version: MavlinkVersion, payload: &mut [u8]) -> usize
fn ser(&self, version: MavlinkVersion, payload: &mut [u8]) -> usize
§Panics
Will panic if the buffer provided is to small to hold the full message payload of the implementing message type
Sourcefn deser(version: MavlinkVersion, payload: &[u8]) -> Result<Self, ParserError>
fn deser(version: MavlinkVersion, payload: &[u8]) -> Result<Self, ParserError>
§Errors
Will return ParserError::InvalidEnum on a nonexistent enum value and
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.