pub struct SuperblockV2V3 {
pub version: u8,
pub sizeof_offsets: u8,
pub sizeof_lengths: u8,
pub file_consistency_flags: u8,
pub base_address: u64,
pub superblock_extension_address: u64,
pub end_of_file_address: u64,
pub root_group_object_header_address: u64,
}Expand description
Superblock v2/v3 structure.
Layout (O = sizeof_offsets):
[0..8] Signature (8 bytes)
[8] Version (1 byte)
[9] Size of Offsets (1 byte)
[10] Size of Lengths (1 byte)
[11] File Consistency Flags (1 byte)
[12..12+O] Base Address (O bytes)
[12+O..12+2O] Superblock Extension Address (O bytes)
[12+2O..12+3O] End of File Address (O bytes)
[12+3O..12+4O] Root Group Object Header Address (O bytes)
[12+4O..12+4O+4] Checksum (4 bytes)Fields§
§version: u8Superblock version: 2 or 3.
sizeof_offsets: u8Size of file offsets in bytes (typically 8).
sizeof_lengths: u8Size of file lengths in bytes (typically 8).
file_consistency_flags: u8File consistency flags (see FLAG_* constants).
base_address: u64Base address of the file (usually 0).
superblock_extension_address: u64Address of the superblock extension object header, or UNDEF.
end_of_file_address: u64End-of-file address.
root_group_object_header_address: u64Address of the root group object header.
Implementations§
Source§impl SuperblockV2V3
impl SuperblockV2V3
Sourcepub fn encoded_size(&self) -> usize
pub fn encoded_size(&self) -> usize
Returns the total encoded size in bytes: 12 + 4*O + 4 (checksum).
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode the superblock to a byte vector, including the trailing checksum.
Sourcepub fn decode(buf: &[u8]) -> FormatResult<Self>
pub fn decode(buf: &[u8]) -> FormatResult<Self>
Decode a superblock from a byte buffer. Verifies the signature, version, and checksum. Returns the parsed superblock.
Trait Implementations§
Source§impl Clone for SuperblockV2V3
impl Clone for SuperblockV2V3
Source§fn clone(&self) -> SuperblockV2V3
fn clone(&self) -> SuperblockV2V3
Returns a duplicate of the value. Read more
1.0.0 · 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 SuperblockV2V3
impl Debug for SuperblockV2V3
Source§impl PartialEq for SuperblockV2V3
impl PartialEq for SuperblockV2V3
impl Eq for SuperblockV2V3
impl StructuralPartialEq for SuperblockV2V3
Auto Trait Implementations§
impl Freeze for SuperblockV2V3
impl RefUnwindSafe for SuperblockV2V3
impl Send for SuperblockV2V3
impl Sync for SuperblockV2V3
impl Unpin for SuperblockV2V3
impl UnsafeUnpin for SuperblockV2V3
impl UnwindSafe for SuperblockV2V3
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