Struct hdf5_rs::File [] [src]

pub struct File {
    // some fields omitted
}

Represents the HDF5 file object.

Methods

impl File
[src]

fn open<P: AsRef<Path>, S: Into<String>>(filename: P, mode: S) -> Result<File>

Create a new file object.

mode File access mode
r Read-only, file must exist
r+ Read/write, file must exist
w Create file, truncate if exists
w-, x Create file, fail if exists
a Read/write if exists, create otherwise

fn size(&self) -> u64

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

fn free_space(&self) -> u64

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

fn is_read_only(&self) -> bool

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

fn dump(&self) -> Option<String>

Returns the output of the h5dump tool. Note that this wouldn't work with core driver.

fn userblock(&self) -> u64

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

fn flush(&self) -> Result<()>

Flushes the file to the storage medium.

fn close(&self)

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

Trait Implementations

impl Object for File
[src]

fn refcount(&self) -> u32

Returns reference count if the handle is valid and 0 otherwise.

fn is_valid(&self) -> bool

Returns true if the object has a valid unlocked identifier (false for pre-defined locked identifiers like property list classes). Read more

fn id_type(&self) -> H5I_type_t

Returns type of the object.

impl Location for File
[src]

fn name(&self) -> String

Returns the name of the object within the file, or empty string if the object doesn't have a name (e.g., an anonymous dataset). Read more

fn filename(&self) -> String

Returns the name of the file containing the named object (or the file itself).

fn file(&self) -> Result<File>

Returns a handle to the file containing the named object (or the file itself).

fn comment(&self) -> Option<String>

Returns the commment attached to the named object, if any.

fn set_comment<S: Into<String>>(&self, comment: S) -> Result<()>

Set or the commment attached to the named object.

fn clear_comment(&self) -> Result<()>

Clear the commment attached to the named object.

impl Container for File
[src]

fn len(&self) -> u64

Returns the number of objects in the container (or 0 if the container is invalid).

fn is_empty(&self) -> bool

Returns true if the container has no linked objects (or if the container is invalid).

fn create_group<S: Into<String>>(&self, name: S) -> Result<Group>

Create a new group in a file or group.

fn group<S: Into<String>>(&self, name: S) -> Result<Group>

Opens an existing group in a file or group.

Creates a soft link. Note: name and path are relative to the current object.

Creates a hard link. Note: name and path are relative to the current object.

Relinks an object. Note: name and path are relative to the current object.

Removes a link to an object from this file or group.

fn new_dataset<T: ToDatatype>(&self) -> DatasetBuilder<T>

Instantiates a new dataset builder.

fn dataset<S: Into<String>>(&self, name: S) -> Result<Dataset>

Opens an existing dataset in the file or group.

impl Debug for File
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Display for File
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.