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
impl MutableFile
Sourcepub fn delete_root_attr(&mut self, name: &str) -> Result<()>
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.
Sourcepub fn delete_group_attr(&mut self, group_path: &str, name: &str) -> Result<()>
pub fn delete_group_attr(&mut self, group_path: &str, name: &str) -> Result<()>
Delete a compact group attribute by group path and attribute name.
Sourcepub fn delete_dataset_attr(
&mut self,
dataset_path: &str,
name: &str,
) -> Result<()>
pub fn delete_dataset_attr( &mut self, dataset_path: &str, name: &str, ) -> Result<()>
Delete a compact dataset attribute by dataset path and attribute name.
Sourcepub fn rename_root_attr(&mut self, old_name: &str, new_name: &str) -> Result<()>
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§impl MutableFile
impl MutableFile
Sourcepub fn create_root_group_link(&mut self, name: &str) -> Result<()>
pub fn create_root_group_link(&mut self, name: &str) -> Result<()>
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.
pub fn create_compact_group_link( &mut self, parent_path: &str, name: &str, ) -> Result<()>
Sourcepub fn create_root_soft_link(
&mut self,
name: &str,
target_path: &str,
) -> Result<()>
pub fn create_root_soft_link( &mut self, name: &str, target_path: &str, ) -> Result<()>
Create a soft link in the root group of an existing compact v2/v3 file.
pub fn create_compact_soft_link( &mut self, parent_path: &str, name: &str, target_path: &str, ) -> Result<()>
Sourcepub fn create_root_external_link(
&mut self,
name: &str,
filename: &str,
object_path: &str,
) -> Result<()>
pub fn create_root_external_link( &mut self, name: &str, filename: &str, object_path: &str, ) -> Result<()>
Create an external link in the root group of an existing compact v2/v3 file.
pub fn create_compact_external_link( &mut self, parent_path: &str, name: &str, filename: &str, object_path: &str, ) -> Result<()>
Sourcepub fn create_root_hard_link(
&mut self,
name: &str,
target_addr: u64,
) -> Result<()>
pub fn create_root_hard_link( &mut self, name: &str, target_addr: u64, ) -> Result<()>
Create a hard link in the root group of an existing compact v2/v3 file.
pub fn create_compact_hard_link( &mut self, parent_path: &str, name: &str, target_addr: u64, ) -> Result<()>
pub fn create_compact_hard_link_to_target_path( &mut self, parent_path: &str, name: &str, target_path: &str, target_addr: u64, ) -> Result<()>
pub fn create_compact_same_group_hard_link( &mut self, parent_path: &str, name: &str, target_name: &str, target_addr: u64, ) -> Result<()>
Sourcepub fn create_root_contiguous_dataset(
&mut self,
spec: &DatasetSpec<'_>,
fill: Option<FillValueSpec<'_>>,
) -> Result<u64>
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.
pub fn create_compact_contiguous_dataset( &mut self, parent_path: &str, spec: &DatasetSpec<'_>, fill: Option<FillValueSpec<'_>>, ) -> Result<u64>
Sourcepub fn unlink_group_link(&mut self, group_path: &str, name: &str) -> Result<()>
pub fn unlink_group_link(&mut self, group_path: &str, name: &str) -> Result<()>
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.
Sourcepub fn rename_group_link(
&mut self,
group_path: &str,
old_name: &str,
new_name: &str,
) -> Result<()>
pub fn rename_group_link( &mut self, group_path: &str, old_name: &str, new_name: &str, ) -> Result<()>
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.
pub fn move_group_link( &mut self, source_group_path: &str, old_name: &str, dest_group_path: &str, new_name: &str, ) -> Result<()>
Source§impl MutableFile
impl MutableFile
Sourcepub fn resize_dataset(&mut self, path: &str, new_dims: &[u64]) -> Result<()>
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
impl MutableFile
Sourcepub fn write_chunk(
&mut self,
dataset_path: &str,
chunk_coords: &[u64],
data: &[u8],
) -> Result<()>
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
impl MutableFile
Sourcepub fn open_rw<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open_rw<P: AsRef<Path>>(path: P) -> Result<Self>
Open an existing HDF5 file for read-write access.
Sourcepub fn root_group(&self) -> Result<Group>
pub fn root_group(&self) -> Result<Group>
Get the root group (read-only access).
Sourcepub fn visit_member_names<F>(&self, visitor: F) -> Result<()>
pub fn visit_member_names<F>(&self, visitor: F) -> Result<()>
Visit member names in the root group.