pub struct PackHeader {
pub format_version: u32,
pub asset_count: u32,
pub flags: u32,
}Expand description
Decoded form of the 24-byte header at the start of data.pack.
Byte layout (all little-endian):
offset size field
────── ──── ─────────────────────────────────────────────────────
0 8 PACK_MAGIC (b"KHORAPK\0")
8 4 format_version: u32 — must equal PACK_FORMAT_VERSION
12 4 asset_count: u32 — sanity check vs. index.bin
16 4 flags: u32 — bit 0 LZ4, bit 1 manifest
20 4 reserved: u32 — zero on writes, ignored on readsFields§
§format_version: u32Format version as written. Equals PACK_FORMAT_VERSION on a pack
produced by this engine; loader refuses anything else.
asset_count: u32Number of assets the producer claims to have written into this
data.pack. Cross-checked against index.bin.len() at boot to
catch a mismatched pair (e.g. user shipped only one of the two
files).
flags: u32Pack-level feature flags (compression, manifest, …). See
PACK_FLAG_* constants.
Implementations§
Trait Implementations§
Source§impl Clone for PackHeader
impl Clone for PackHeader
Source§fn clone(&self) -> PackHeader
fn clone(&self) -> PackHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackHeader
impl Debug for PackHeader
impl Copy for PackHeader
Auto Trait Implementations§
impl Freeze for PackHeader
impl RefUnwindSafe for PackHeader
impl Send for PackHeader
impl Sync for PackHeader
impl Unpin for PackHeader
impl UnsafeUnpin for PackHeader
impl UnwindSafe for PackHeader
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
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