pub struct Superblock {Show 14 fields
pub version: u8,
pub offset_size: u8,
pub length_size: u8,
pub group_leaf_node_k: u16,
pub group_internal_node_k: u16,
pub indexed_storage_k: u16,
pub consistency_flags: u32,
pub base_address: u64,
pub free_space_address: u64,
pub eof_address: u64,
pub driver_info_address: u64,
pub root_symbol_table_entry: Option<SymbolTableEntry>,
pub root_object_header_address: Option<u64>,
pub extension_address: Option<u64>,
}Expand description
Parsed HDF5 superblock.
Fields§
§version: u8Superblock version (0, 1, 2, or 3).
offset_size: u8Size of offsets (addresses) in bytes: 2, 4, or 8.
length_size: u8Size of lengths in bytes: 2, 4, or 8.
group_leaf_node_k: u16Group leaf node K (v0/v1 only).
group_internal_node_k: u16Group internal node K (v0/v1 only).
indexed_storage_k: u16Indexed storage internal node K (v1 only).
consistency_flags: u32File consistency flags.
base_address: u64Base address for offsets (usually 0).
free_space_address: u64Address of the file free-space info (undefined = not present).
eof_address: u64End-of-file address.
driver_info_address: u64Driver information block address (v0/v1 only).
root_symbol_table_entry: Option<SymbolTableEntry>Root group symbol table entry (v0/v1).
root_object_header_address: Option<u64>Root group object header address (v2/v3).
extension_address: Option<u64>Superblock extension address (v2/v3).
Implementations§
Source§impl Superblock
impl Superblock
Sourcepub fn parse(cursor: &mut Cursor<'_>) -> Result<Self>
pub fn parse(cursor: &mut Cursor<'_>) -> Result<Self>
Parse the superblock from a cursor positioned at byte 0 (or where the magic starts).
The cursor should be positioned at the start of the file. The method will search for the magic bytes at position 0, 512, 1024, 2048, etc.
Sourcepub fn root_object_header_address(&self) -> Result<u64>
pub fn root_object_header_address(&self) -> Result<u64>
Get the root group’s object header address.
Sourcepub fn root_btree_address(&self) -> Option<u64>
pub fn root_btree_address(&self) -> Option<u64>
For v0/v1 superblocks, get the B-tree address from the root symbol table entry’s scratch-pad (used for root group navigation).
Sourcepub fn root_local_heap_address(&self) -> Option<u64>
pub fn root_local_heap_address(&self) -> Option<u64>
For v0/v1 superblocks, get the local heap address from the root symbol table entry’s scratch-pad.
Trait Implementations§
Source§impl Clone for Superblock
impl Clone for Superblock
Source§fn clone(&self) -> Superblock
fn clone(&self) -> Superblock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Superblock
impl RefUnwindSafe for Superblock
impl Send for Superblock
impl Sync for Superblock
impl Unpin for Superblock
impl UnsafeUnpin for Superblock
impl UnwindSafe for Superblock
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
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>
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>
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