make packet repr(C)
Some checks failed
Rust / build (pull_request) Failing after 1m1s

This commit is contained in:
Vinzenz Schroeter 2025-04-12 11:16:48 +02:00
parent ff56215c06
commit fbd85f644b

View file

@ -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,