Skip to main content

Superblock

Struct Superblock 

Source
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: u8

Superblock version (0, 1, 2, or 3).

§offset_size: u8

Size of offsets (addresses) in bytes: 2, 4, or 8.

§length_size: u8

Size of lengths in bytes: 2, 4, or 8.

§group_leaf_node_k: u16

Group leaf node K (v0/v1 only).

§group_internal_node_k: u16

Group internal node K (v0/v1 only).

§indexed_storage_k: u16

Indexed storage internal node K (v1 only).

§consistency_flags: u32

File consistency flags.

§base_address: u64

Base address for offsets (usually 0).

§free_space_address: u64

Address of the file free-space info (undefined = not present).

§eof_address: u64

End-of-file address.

§driver_info_address: u64

Driver 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

Source

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.

Source

pub fn root_object_header_address(&self) -> Result<u64>

Get the root group’s object header address.

Source

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).

Source

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

Source§

fn clone(&self) -> Superblock

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Superblock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.