pub struct FileHeader {
pub version: u32,
pub dir_offset: u64,
pub chunk_count: u32,
pub flags: u32,
pub total_uncompressed_size: u64,
}Expand description
The fixed 32-byte file header at offset 0.
Fields§
§version: u32Container format version. 1 for this specification.
dir_offset: u64Byte offset from the start of the file to the chunk directory.
chunk_count: u32Number of chunks, matching the directory entries.
flags: u32Bitfield: bit 1 MULTI_SECTOR, bit 3 ENCRYPTED.
total_uncompressed_size: u64Sum of uncompressed chunk sizes, or 0 when unknown.
Implementations§
Source§impl FileHeader
impl FileHeader
Sourcepub fn parse(buf: &[u8]) -> Result<FileHeader>
pub fn parse(buf: &[u8]) -> Result<FileHeader>
Parse the fixed header.
Sourcepub fn multi_sector(&self) -> bool
pub fn multi_sector(&self) -> bool
Whether the file declares sector-based layer encoding.
Sourcepub fn reserved_flags(&self) -> u32
pub fn reserved_flags(&self) -> u32
Flags a v1 writer must leave clear.
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
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 moreimpl Copy for FileHeader
Source§impl Debug for FileHeader
impl Debug for FileHeader
impl Eq for FileHeader
Source§impl PartialEq for FileHeader
impl PartialEq for FileHeader
impl StructuralPartialEq for FileHeader
Auto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnsafeUnpin for FileHeader
impl UnwindSafe for FileHeader
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