pub struct DotthzFile { /* private fields */ }Expand description
A structure representing a .thz file according to the dotThz standard
Implementations§
Source§impl DotthzFile
impl DotthzFile
Sourcepub fn create(path: &PathBuf) -> Result<Self, Box<dyn Error>>
pub fn create(path: &PathBuf) -> Result<Self, Box<dyn Error>>
Create an empty DotthzFile to the specified path, truncates if exists.
Sourcepub fn open(filename: &PathBuf) -> Result<Self, Box<dyn Error>>
pub fn open(filename: &PathBuf) -> Result<Self, Box<dyn Error>>
Loads a DotthzFile from the specified path as read-only, file must exist.
Sourcepub fn open_rw<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
pub fn open_rw<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
Opens a file as read/write, file must exist.
Sourcepub fn create_excl<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
pub fn create_excl<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
Creates a file, fails if exists.
Sourcepub fn append<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
pub fn append<P: AsRef<Path>>(filename: P) -> Result<Self, Box<dyn Error>>
Opens a file as read/write if exists, creates otherwise.
Sourcepub fn open_as<P: AsRef<Path>>(
filename: P,
mode: OpenMode,
) -> Result<Self, Box<dyn Error>>
pub fn open_as<P: AsRef<Path>>( filename: P, mode: OpenMode, ) -> Result<Self, Box<dyn Error>>
Opens a file in a given mode.
Sourcepub fn free_space(&self) -> u64
pub fn free_space(&self) -> u64
Returns the free space in the file in bytes (or 0 if the file handle is invalid).
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns true if the file was opened in a read-only mode.
Sourcepub fn userblock(&self) -> u64
pub fn userblock(&self) -> u64
Returns the userblock size in bytes (or 0 if the file handle is invalid).
Sourcepub fn close(self) -> Result<(), Box<dyn Error>>
pub fn close(self) -> Result<(), Box<dyn Error>>
Closes the file and invalidates all open handles for contained objects.
Sourcepub fn access_plist(&self) -> Result<FileAccess>
pub fn access_plist(&self) -> Result<FileAccess>
Returns a copy of the file access property list.
Sourcepub fn fapl(&self) -> Result<FileAccess>
pub fn fapl(&self) -> Result<FileAccess>
A short alias for access_plist().
Sourcepub fn create_plist(&self) -> Result<FileCreate>
pub fn create_plist(&self) -> Result<FileCreate>
Returns a copy of the file creation property list.
Sourcepub fn fcpl(&self) -> Result<FileCreate>
pub fn fcpl(&self) -> Result<FileCreate>
A short alias for create_plist().
Sourcepub fn get_group_names(&self) -> Result<Vec<String>>
pub fn get_group_names(&self) -> Result<Vec<String>>
get group names
Sourcepub fn get_groups(&self) -> Result<Vec<Group>>
pub fn get_groups(&self) -> Result<Vec<Group>>
get groups
Sourcepub fn get_dataset_names(&self, group_name: &str) -> Result<Vec<String>>
pub fn get_dataset_names(&self, group_name: &str) -> Result<Vec<String>>
get dataset names for a given group name
Sourcepub fn get_dataset(
&self,
group_name: &str,
dataset_name: &str,
) -> Result<Dataset>
pub fn get_dataset( &self, group_name: &str, dataset_name: &str, ) -> Result<Dataset>
get dataset for a given group name by dataset name
Sourcepub fn get_datasets(&self, group_name: &str) -> Result<Vec<Dataset>>
pub fn get_datasets(&self, group_name: &str) -> Result<Vec<Dataset>>
get datasets for a given group name
Sourcepub fn set_meta_data(
&self,
group: &mut Group,
meta_data: &DotthzMetaData,
) -> Result<(), Box<dyn Error>>
pub fn set_meta_data( &self, group: &mut Group, meta_data: &DotthzMetaData, ) -> Result<(), Box<dyn Error>>
set meta-data for a given group
Sourcepub fn get_meta_data(&self, group_name: &str) -> Result<DotthzMetaData>
pub fn get_meta_data(&self, group_name: &str) -> Result<DotthzMetaData>
extract meta-data for a given group by group name