pub struct ExplicitCompoundTypeBuilder { /* private fields */ }Expand description
Builder for an HDF5 compound datatype with explicit field offsets and size.
This is the pure-Rust equivalent of creating an H5T_COMPOUND type and
inserting fields with H5Tinsert. build validates field
names, bounds, and overlap before returning a datatype.
Implementations§
Source§impl ExplicitCompoundTypeBuilder
impl ExplicitCompoundTypeBuilder
Sourcepub fn field(self, name: &str, byte_offset: u64, datatype: Datatype) -> Self
pub fn field(self, name: &str, byte_offset: u64, datatype: Datatype) -> Self
Add a field at an explicit byte offset.
Sourcepub fn f64_field(self, name: &str, byte_offset: u64) -> Self
pub fn f64_field(self, name: &str, byte_offset: u64) -> Self
Add an f64 field at an explicit byte offset.
Sourcepub fn f32_field(self, name: &str, byte_offset: u64) -> Self
pub fn f32_field(self, name: &str, byte_offset: u64) -> Self
Add an f32 field at an explicit byte offset.
Sourcepub fn i32_field(self, name: &str, byte_offset: u64) -> Self
pub fn i32_field(self, name: &str, byte_offset: u64) -> Self
Add an i32 field at an explicit byte offset.
Sourcepub fn i64_field(self, name: &str, byte_offset: u64) -> Self
pub fn i64_field(self, name: &str, byte_offset: u64) -> Self
Add an i64 field at an explicit byte offset.
Sourcepub fn u8_field(self, name: &str, byte_offset: u64) -> Self
pub fn u8_field(self, name: &str, byte_offset: u64) -> Self
Add a u8 field at an explicit byte offset.
Sourcepub fn i8_field(self, name: &str, byte_offset: u64) -> Self
pub fn i8_field(self, name: &str, byte_offset: u64) -> Self
Add an i8 field at an explicit byte offset.
Sourcepub fn i16_field(self, name: &str, byte_offset: u64) -> Self
pub fn i16_field(self, name: &str, byte_offset: u64) -> Self
Add an i16 field at an explicit byte offset.
Sourcepub fn u16_field(self, name: &str, byte_offset: u64) -> Self
pub fn u16_field(self, name: &str, byte_offset: u64) -> Self
Add a u16 field at an explicit byte offset.
Sourcepub fn u32_field(self, name: &str, byte_offset: u64) -> Self
pub fn u32_field(self, name: &str, byte_offset: u64) -> Self
Add a u32 field at an explicit byte offset.
Sourcepub fn u64_field(self, name: &str, byte_offset: u64) -> Self
pub fn u64_field(self, name: &str, byte_offset: u64) -> Self
Add a u64 field at an explicit byte offset.
Sourcepub fn build(self) -> Result<Datatype, FormatError>
pub fn build(self) -> Result<Datatype, FormatError>
Validate and build the compound datatype.