This commit is contained in:
parent
ff56215c06
commit
fbd85f644b
|
@ -33,6 +33,7 @@ use std::{mem::size_of, num::TryFromIntError};
|
|||
///
|
||||
/// Because the meaning of most fields depend on the command, there are no speaking names for them.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Default)]
|
||||
#[repr(C)]
|
||||
pub struct Header {
|
||||
/// The first two bytes specify which command this packet represents.
|
||||
pub command_code: u16,
|
||||
|
@ -57,6 +58,7 @@ pub type Payload = Vec<u8>;
|
|||
///
|
||||
/// You may want to use [`crate::Command`] or [`crate::TypedCommand`] instead.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[repr(C)]
|
||||
pub struct Packet {
|
||||
/// Meta-information for the packed command
|
||||
pub header: Header,
|
||||
|
|
Loading…
Reference in a new issue