pub struct MavFrame<M>where
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> MavFrame<M>where
M: Message,
impl<M> MavFrame<M>where
M: Message,
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<MavFrame<M>, ParserError>
pub fn deser( version: MavlinkVersion, input: &[u8] ) -> Result<MavFrame<M>, ParserError>
Deserialize MavFrame from a slice that has been received from, for example, a socket.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for MavFrame<M>where
M: Freeze,
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