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 base_address: u64, pub eof_address: u64, pub root_group_address: u64, pub group_leaf_node_k: Option<u16>, pub group_internal_node_k: Option<u16>, pub indexed_storage_internal_node_k: Option<u16>, pub free_space_address: Option<u64>, pub driver_info_address: Option<u64>, pub consistency_flags: u32, pub superblock_extension_address: Option<u64>, pub checksum: Option<u32>,
}
Expand description

Parsed HDF5 superblock (all versions).

Fields§

§version: u8

Superblock version (0–3).

§offset_size: u8

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

§length_size: u8

Size of lengths in bytes (2, 4, or 8).

§base_address: u64

File base address.

§eof_address: u64

End-of-file address.

§root_group_address: u64

Root group object header address (v2/v3) or from symbol table entry (v0/v1).

§group_leaf_node_k: Option<u16>

Group leaf node K (v0/v1 only).

§group_internal_node_k: Option<u16>

Group internal node K (v0/v1 only).

§indexed_storage_internal_node_k: Option<u16>

Indexed storage internal node K (v1 only).

§free_space_address: Option<u64>

Free space address (v0/v1 only).

§driver_info_address: Option<u64>

Driver info block address (v0/v1 only).

§consistency_flags: u32

File consistency flags.

§superblock_extension_address: Option<u64>

Superblock extension address (v2/v3 only).

§checksum: Option<u32>

CRC32C checksum (v2/v3 only).

Implementations§

Source§

impl Superblock

Source

pub fn serialize(&self) -> Vec<u8>

Serialize this superblock to bytes.

Always writes v2/v3 format. Computes and appends Jenkins lookup3 checksum.

Source

pub fn parse( data: &[u8], signature_offset: usize, ) -> Result<Superblock, FormatError>

Parse a superblock from data starting at signature_offset.

The signature must be present at the given offset.

Trait Implementations§

Source§

impl Clone for Superblock

Source§

fn clone(&self) -> Superblock

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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
Source§

impl Eq for Superblock

Source§

impl PartialEq for Superblock

Source§

fn eq(&self, other: &Superblock) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Superblock

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.