pub struct CompoundType {
pub members: Vec<(String, DatatypeMessage, u32)>,
pub total_size: u32,
}Expand description
A description of a compound (struct) type for use with HDF5 datasets.
Users can build compound types manually to describe structured data.
§Example
use rust_hdf5::types::CompoundType;
use rust_hdf5::format::messages::datatype::{DatatypeMessage, CompoundMember};
let ct = CompoundType {
members: vec![
("x".to_string(), DatatypeMessage::f32_type(), 0),
("y".to_string(), DatatypeMessage::f32_type(), 4),
],
total_size: 8,
};
let dt = ct.to_datatype();
assert_eq!(dt.element_size(), 8);Fields§
§members: Vec<(String, DatatypeMessage, u32)>Members: (name, datatype, byte_offset).
total_size: u32Total size of the compound element in bytes.
Implementations§
Source§impl CompoundType
impl CompoundType
Sourcepub fn to_datatype(&self) -> DatatypeMessage
pub fn to_datatype(&self) -> DatatypeMessage
Convert this compound type description to a DatatypeMessage.
Trait Implementations§
Source§impl Clone for CompoundType
impl Clone for CompoundType
Source§fn clone(&self) -> CompoundType
fn clone(&self) -> CompoundType
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 moreAuto Trait Implementations§
impl Freeze for CompoundType
impl RefUnwindSafe for CompoundType
impl Send for CompoundType
impl Sync for CompoundType
impl Unpin for CompoundType
impl UnsafeUnpin for CompoundType
impl UnwindSafe for CompoundType
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