Skip to main content

MutableFile

Struct MutableFile 

Source
pub struct MutableFile { /* private fields */ }
Expand description

A mutable HDF5 file opened for read-write access.

Supports resizing chunked datasets and writing new chunks.

Implementations§

Source§

impl MutableFile

Source

pub fn delete_root_attr(&mut self, name: &str) -> Result<()>

Delete a compact root attribute by name.

This is an in-place object-header edit for compact attributes. Dense attribute storage requires fractal-heap/B-tree mutation and is rejected explicitly for now.

Source

pub fn delete_group_attr(&mut self, group_path: &str, name: &str) -> Result<()>

Delete a compact group attribute by group path and attribute name.

Source

pub fn delete_dataset_attr( &mut self, dataset_path: &str, name: &str, ) -> Result<()>

Delete a compact dataset attribute by dataset path and attribute name.

Source

pub fn rename_root_attr(&mut self, old_name: &str, new_name: &str) -> Result<()>

Rename a compact root attribute in-place.

The new name must fit in the existing compact attribute name field so the compact object-header message size remains unchanged.

Source

pub fn rename_group_attr( &mut self, group_path: &str, old_name: &str, new_name: &str, ) -> Result<()>

Rename a compact group attribute in-place.

Source

pub fn rename_dataset_attr( &mut self, dataset_path: &str, old_name: &str, new_name: &str, ) -> Result<()>

Rename a compact dataset attribute in-place.

Source§

impl MutableFile

Create a child group by rewriting compact v2/v3 metadata.

Root children rewrite the root header and superblock. Nested compact children rewrite each compact hard-link ancestor up to the root so moved object-header addresses remain reachable.

Create a soft link in the root group of an existing compact v2/v3 file.

Create an external link in the root group of an existing compact v2/v3 file.

Create a hard link in the root group of an existing compact v2/v3 file.

Source

pub fn create_root_contiguous_dataset( &mut self, spec: &DatasetSpec<'_>, fill: Option<FillValueSpec<'_>>, ) -> Result<u64>

Create a contiguous simple dataset in the root group of an existing compact v2/v3 file.

Source

pub fn create_compact_contiguous_dataset( &mut self, parent_path: &str, spec: &DatasetSpec<'_>, fill: Option<FillValueSpec<'_>>, ) -> Result<u64>

Delete a compact link from a group.

This is an in-place hdf5-metno compatibility mutation. It currently supports only v2 object headers with compact link messages.

Rename a compact link in a group without changing the encoded name size.

Moving between groups or changing the encoded message length needs object-header growth and is rejected explicitly for now.

Source§

impl MutableFile

Source

pub fn resize_dataset(&mut self, path: &str, new_dims: &[u64]) -> Result<()>

Resize a chunked dataset to new dimensions.

The new dimensions must not exceed the dataset’s maximum dimensions. Whole v2-B-tree chunks outside a shrunken extent are pruned; other chunk data is left in place. New regions are filled with the default fill value (zeros).

Source§

impl MutableFile

Source

pub fn write_chunk( &mut self, dataset_path: &str, chunk_coords: &[u64], data: &[u8], ) -> Result<()>

Write a full uncompressed chunk and update the dataset’s chunk index.

This supports chunked datasets written by this crate where the chunk index variant is one of the currently mutable writer-side subsets.

Source§

impl MutableFile

Source

pub fn open_rw<P: AsRef<Path>>(path: P) -> Result<Self>

Open an existing HDF5 file for read-write access.

Source

pub fn root_group(&self) -> Result<Group>

Get the root group (read-only access).

Source

pub fn visit_member_names<F>(&self, visitor: F) -> Result<()>
where F: FnMut(&str) -> Result<()>,

Visit member names in the root group.

Source

pub fn dataset(&self, path: &str) -> Result<Dataset>

Open a dataset by path.

Source

pub fn group(&self, path: &str) -> Result<Group>

Open a group by path.

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