pub struct MishHeader {Show 13 fields
pub magic: [u8; 4],
pub version: u32,
pub first_sector: u64,
pub sector_count: u64,
pub data_offset: u64,
pub buffers_needed: u32,
pub block_descriptor_count: u32,
pub reserved: [u8; 24],
pub checksum_type: u32,
pub checksum_size: u32,
pub checksum: [u8; 128],
pub actual_block_count: u32,
pub block_runs: Vec<BlockRun>,
}Expand description
Mish (block map) header structure
The mish header is 204 bytes total:
- 4 bytes: magic “mish”
- 4 bytes: version
- 8 bytes: first_sector
- 8 bytes: sector_count
- 8 bytes: data_offset
- 4 bytes: buffers_needed
- 4 bytes: block_descriptor_count
- 24 bytes: reserved1
- 4 bytes: checksum_type
- 4 bytes: checksum_size
- 128 bytes: checksum
- 4 bytes: reserved2 (total block count sometimes)
Fields§
§magic: [u8; 4]Magic bytes “mish”
version: u32Version
first_sector: u64First sector
sector_count: u64Sector count
data_offset: u64Data offset
buffers_needed: u32Buffers needed
block_descriptor_count: u32Block descriptor count
reserved: [u8; 24]Reserved
checksum_type: u32Checksum type
checksum_size: u32Checksum size
checksum: [u8; 128]Checksum (128 bytes)
actual_block_count: u32Actual block count (at offset 200 in mish header)
block_runs: Vec<BlockRun>Block runs
Implementations§
Source§impl MishHeader
impl MishHeader
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Parse mish header from base64-decoded data
Sourcepub fn uncompressed_size(&self) -> u64
pub fn uncompressed_size(&self) -> u64
Calculate total uncompressed size in bytes
Sourcepub fn compressed_size(&self) -> u64
pub fn compressed_size(&self) -> u64
Calculate total compressed size in bytes
Trait Implementations§
Source§impl Clone for MishHeader
impl Clone for MishHeader
Source§fn clone(&self) -> MishHeader
fn clone(&self) -> MishHeader
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 moreAuto Trait Implementations§
impl Freeze for MishHeader
impl RefUnwindSafe for MishHeader
impl Send for MishHeader
impl Sync for MishHeader
impl Unpin for MishHeader
impl UnsafeUnpin for MishHeader
impl UnwindSafe for MishHeader
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