pub struct Dataspace {
pub space_type: DataspaceType,
pub rank: u8,
pub dimensions: Vec<u64>,
pub max_dimensions: Option<Vec<u64>>,
}Expand description
Parsed HDF5 dataspace message.
Fields§
§space_type: DataspaceTypeThe type of this dataspace.
rank: u8Number of dimensions (0 for scalar).
dimensions: Vec<u64>Current dimension sizes.
max_dimensions: Option<Vec<u64>>Maximum dimension sizes, if present. u64::MAX means unlimited.
Implementations§
Source§impl Dataspace
impl Dataspace
Sourcepub fn parse(data: &[u8], length_size: u8) -> Result<Dataspace, FormatError>
pub fn parse(data: &[u8], length_size: u8) -> Result<Dataspace, FormatError>
Parse a dataspace message from raw message bytes.
length_size is needed for dimension value width (from superblock).
Sourcepub fn serialize(&self, length_size: u8) -> Vec<u8> ⓘ
pub fn serialize(&self, length_size: u8) -> Vec<u8> ⓘ
Serialize dataspace to HDF5 message bytes (v2 format).
Sourcepub fn num_elements(&self) -> u64
pub fn num_elements(&self) -> u64
Total number of elements. Scalar = 1, Null = 0.
Trait Implementations§
impl StructuralPartialEq for Dataspace
Auto Trait Implementations§
impl Freeze for Dataspace
impl RefUnwindSafe for Dataspace
impl Send for Dataspace
impl Sync for Dataspace
impl Unpin for Dataspace
impl UnsafeUnpin for Dataspace
impl UnwindSafe for Dataspace
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