pub struct MavFrame<M: Message> {
pub header: MavHeader,
pub msg: M,
pub protocol_version: MavlinkVersion,
}
Expand description
Encapsulation of the Mavlink message and the header, important to preserve information about the sender system and component id
Fields§
§header: MavHeader
§msg: M
§protocol_version: MavlinkVersion
Implementations§
source§impl<M: Message> MavFrame<M>
impl<M: Message> MavFrame<M>
sourcepub fn ser(&self, buf: &mut [u8]) -> usize
pub fn ser(&self, buf: &mut [u8]) -> usize
Create a new frame with given message Serialize MavFrame into a vector, so it can be sent over a socket, for example.
sourcepub fn deser(version: MavlinkVersion, input: &[u8]) -> Result<Self, ParserError>
pub fn deser(version: MavlinkVersion, input: &[u8]) -> Result<Self, ParserError>
Deserialize MavFrame from a slice that has been received from, for example, a socket.
Trait Implementations§
Auto Trait Implementations§
impl<M> RefUnwindSafe for MavFrame<M>where M: RefUnwindSafe,
impl<M> Send for MavFrame<M>where M: Send,
impl<M> Sync for MavFrame<M>where M: Sync,
impl<M> Unpin for MavFrame<M>where M: Unpin,
impl<M> UnwindSafe for MavFrame<M>where M: UnwindSafe,
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