Skip to main content

MAVLinkV1MessageRaw

Struct MAVLinkV1MessageRaw 

Source
pub struct MAVLinkV1MessageRaw(/* private fields */);
Expand description

Byte buffer containing the raw representation of a MAVLink 1 message beginning with the STX marker.

Follow protocol definition: https://mavlink.io/en/guide/serialization.html#v1_packet_format. Maximum size is 263 bytes.

Implementations§

Source§

impl MAVLinkV1MessageRaw

Source

pub const fn new() -> Self

Create a new raw MAVLink 1 message filled with zeros.

Source

pub const fn from_bytes_unparsed(bytes: [u8; 263]) -> Self

Create a new raw MAVLink 1 message from a given buffer.

Note: This method does not guarantee that the constructed MAVLink message is valid.

Source

pub fn as_slice(&self) -> &[u8]

Read access to its internal buffer.

Source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Mutable reference to its internal buffer.

Source

pub fn into_inner(self) -> [u8; 263]

Deconstruct the MAVLink message into its owned internal buffer.

Source

pub fn header(&self) -> &[u8]

Reference to the 5 byte header slice of the message

Source

pub fn payload_length(&self) -> u8

Size of the payload of the message

Source

pub fn sequence(&self) -> u8

Packet sequence number

Source

pub fn system_id(&self) -> u8

Message sender System ID

Source

pub fn component_id(&self) -> u8

Message sender Component ID

Source

pub fn message_id(&self) -> u8

Message ID

Source

pub fn payload(&self) -> &[u8]

Reference to the payload byte slice of the message

Source

pub fn checksum(&self) -> u16

CRC-16 checksum field of the message

Source

pub fn has_valid_crc<M: Message>(&self) -> bool

Checks wether the message’s CRC-16 checksum calculation matches its checksum field.

Source

pub fn raw_bytes(&self) -> &[u8]

Raw byte slice of the message

Source

pub fn serialize_message<M: Message>(&mut self, header: MavHeader, message: &M)

Serialize a Message with a given header into this raw message buffer.

§Panics

If the message’s id exceeds 255 and is therefore not supported for MAVLink 1

Source

pub fn serialize_message_data<D: MessageData>( &mut self, header: MavHeader, message_data: &D, )

§Panics

If the MessageData’s ID exceeds 255 and is therefore not supported for MAVLink 1

Trait Implementations§

Source§

impl Clone for MAVLinkV1MessageRaw

Source§

fn clone(&self) -> MAVLinkV1MessageRaw

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MAVLinkV1MessageRaw

Source§

impl Debug for MAVLinkV1MessageRaw

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MAVLinkV1MessageRaw

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MAVLinkV1MessageRaw

Source§

impl PartialEq for MAVLinkV1MessageRaw

Source§

fn eq(&self, other: &MAVLinkV1MessageRaw) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MAVLinkV1MessageRaw

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.