pub struct Message {
pub id: u32,
pub name: String,
pub description: String,
pub fields: Vec<Field>,
pub crc_extra: u8,
pub base_len: usize,
pub max_len: usize,
}Expand description
A message definition.
Fields§
§id: u32Message id.
name: StringMessage name, for example PARTICIPANT_POSITION.
description: StringDescription text.
fields: Vec<Field>Fields in wire order: base fields sorted by element size (largest first, stable), then extension fields in XML order.
crc_extra: u8CRC_EXTRA seed byte.
base_len: usizePayload length without extensions (the MAVLink 1 length).
max_len: usizePayload length with extensions.
Implementations§
Source§impl Message
impl Message
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
True if this message is out of scope (target, track, handover,
fires, munition, arming, weapon, engagement or payload, see
super::scope). Its fields are never decoded or encoded.
Sourcepub fn get(&self, payload: &[u8], name: &str) -> Option<Value>
pub fn get(&self, payload: &[u8], name: &str) -> Option<Value>
Decodes field name from payload. MAVLink 2 trims trailing zero
bytes, so missing bytes read as zero. None for a blocked message
(Message::is_blocked).
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Forget for Message
impl Freeze for Message
impl Move for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more