Skip to main content

MessageData

Trait MessageData 

Source
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§

Required Associated Types§

Required Methods§

Source

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

Source

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".

Implementors§