pub trait PackedStruct: Sized {
const PACKED_SIZE: usize;
// Required method
fn from_packed_bytes(bytes: &[u8]) -> Option<Self>;
}Expand description
A trait for types that can be read from and written to packed byte representations.
This trait provides methods for handling structures that contain I24 values
mixed with native types, working around the nested packing limitation.
Required Associated Constants§
Sourceconst PACKED_SIZE: usize
const PACKED_SIZE: usize
The size in bytes of the packed representation.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.