pub struct Header {
pub magic: [u8; 4],
pub version: (u8, u8),
pub model_type: ModelType,
pub metadata_size: u32,
pub payload_size: u32,
pub uncompressed_size: u32,
pub compression: Compression,
pub flags: Flags,
pub quality_score: u8,
}Expand description
File header (32 bytes).
Fields§
§magic: [u8; 4]Magic number (must be “APRN”)
version: (u8, u8)Format version (major, minor)
model_type: ModelTypeModel type identifier
metadata_size: u32Metadata section size in bytes
payload_size: u32Compressed payload size in bytes
uncompressed_size: u32Uncompressed payload size (for allocation check)
compression: CompressionCompression algorithm
flags: FlagsFeature flags
quality_score: u8Quality score (0-100, Poka-yoke validation) - APR-POKA-001 0 = no validation (F), 1-59 = failing, 60-100 = passing grades
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Header, AprFormatError>
pub fn from_bytes(bytes: &[u8]) -> Result<Header, AprFormatError>
Parse header from bytes.
§Errors
Returns an error on short input, bad magic, unsupported version, unknown model type, unknown compression, or a compression-bomb-sized payload.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more