Struct DotthzFile

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

A structure representing a .thz file according to the dotThz standard

Implementations§

Source§

impl DotthzFile

Source

pub fn create(path: &PathBuf) -> Result<Self, Box<dyn Error>>

Create an empty DotthzFile to the specified path, truncates if exists.

Source

pub fn open(filename: &PathBuf) -> Result<Self, Box<dyn Error>>

Loads a DotthzFile from the specified path as read-only, file must exist.

Source

pub fn open_rw<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>

Opens a file as read/write, file must exist.

Source

pub fn create_excl<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>

Creates a file, fails if exists.

Source

pub fn append<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>

Opens a file as read/write if exists, creates otherwise.

Source

pub fn open_as<P: AsRef<Path>>( filename: P, mode: OpenMode, ) -> Result<Self, Box<dyn Error>>

Opens a file in a given mode.

Source

pub fn size(&self) -> u64

Returns the file size in bytes (or 0 if the file handle is invalid).

Source

pub fn free_space(&self) -> u64

Returns the free space in the file in bytes (or 0 if the file handle is invalid).

Source

pub fn is_read_only(&self) -> bool

Returns true if the file was opened in a read-only mode.

Source

pub fn userblock(&self) -> u64

Returns the userblock size in bytes (or 0 if the file handle is invalid).

Source

pub fn flush(&self) -> Result<(), Box<dyn Error>>

Flushes the file to the storage medium.

Source

pub fn close(self) -> Result<(), Box<dyn Error>>

Closes the file and invalidates all open handles for contained objects.

Source

pub fn access_plist(&self) -> Result<FileAccess>

Returns a copy of the file access property list.

Source

pub fn fapl(&self) -> Result<FileAccess>

A short alias for access_plist().

Source

pub fn create_plist(&self) -> Result<FileCreate>

Returns a copy of the file creation property list.

Source

pub fn fcpl(&self) -> Result<FileCreate>

A short alias for create_plist().

Source

pub fn get_group_names(&self) -> Result<Vec<String>>

get group names

Source

pub fn get_group(&self, group_name: &str) -> Result<Group>

get group by name

Source

pub fn get_groups(&self) -> Result<Vec<Group>>

get groups

Source

pub fn get_dataset_names(&self, group_name: &str) -> Result<Vec<String>>

get dataset names for a given group name

Source

pub fn get_dataset( &self, group_name: &str, dataset_name: &str, ) -> Result<Dataset>

get dataset for a given group name by dataset name

Source

pub fn get_datasets(&self, group_name: &str) -> Result<Vec<Dataset>>

get datasets for a given group name

Source

pub fn set_meta_data( &self, group: &mut Group, meta_data: &DotthzMetaData, ) -> Result<(), Box<dyn Error>>

set meta-data for a given group

Source

pub fn get_meta_data(&self, group_name: &str) -> Result<DotthzMetaData>

extract meta-data for a given group by group name

Source

pub fn add_group( &mut self, group_name: &str, metadata: &DotthzMetaData, ) -> Result<Group, Box<dyn Error>>

Add a group with meta-data and group name to the DotthzFile.

Source

pub fn add_dataset<T, D>( &mut self, group_name: &str, dataset_name: &str, dataset: ArrayView<'_, T, D>, ) -> Result<(), Box<dyn Error>>
where T: H5Type + Debug, D: Dimension,

Add a dataset to a given group by group name and dataset name.

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.