#[non_exhaustive]pub enum Error {
Io(Error),
Format(FormatError),
NotADataset(String),
MissingMessage(MessageType),
AlignmentError(String),
Shape(String),
SwmrUnsupported,
SwmrAppendUnsupported(&'static str),
EditUnsupported(&'static str),
RepackUnsupported(String),
FileLocked(String),
}Expand description
Errors that can occur when using the high-level API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
I/O error from the filesystem.
Format(FormatError)
Low-level format parsing error.
NotADataset(String)
The object at the given path is not a dataset.
MissingMessage(MessageType)
A required header message was not found.
AlignmentError(String)
Alignment or size error for zero-copy typed access.
Shape(String)
An array shape error from the ndarray integration: either the flat
data could not be reshaped to the dataset’s dimensions, or a requested
static rank (e.g. read_array::<_, Ix2>) did not match the dataset’s
runtime rank. Only constructed when the ndarray feature is enabled.
SwmrUnsupported
A SWMR operation (e.g. crate::File::refresh) was requested on a file
that was not opened for SWMR reading via File::open_swmr.
SwmrAppendUnsupported(&'static str)
The file or dataset is not a supported target for the SWMR append writer (e.g. a userblock or non-latest-format file, or a dataset that is filtered, not rank-1 with an unlimited dimension, or not Extensible-Array indexed). The payload is a human-readable reason.
EditUnsupported(&'static str)
The file or the requested object is not a supported target for the
in-place editor (crate::EditSession) — for example a userblock or
non-latest-format file, a group whose links are densely stored, or a
dataset shape/datatype/filter combination the in-place writer cannot
emit yet. The payload is a human-readable reason.
RepackUnsupported(String)
An object in the source file cannot be reproduced faithfully by
repack, so the repack was refused rather than write a
silently degraded file — for example a variable-length, time, bitfield,
or opaque datatype, a virtual/external data layout, an unsupported
filter, or an object reference. The payload names the object and reason.
FileLocked(String)
The file could not be opened because another process holds a conflicting
OS advisory lock — for a writer (crate::SwmrWriter,
crate::EditSession) this means another writer or reader is active;
for a plain reader it means a writer is active. The lock is released
automatically when the holder’s process exits, so a crashed writer does
not leave a stale lock. Locking can be disabled per open with
crate::FileLocking::Disabled or globally with
HDF5_USE_FILE_LOCKING=FALSE. The payload is a human-readable reason.
Trait Implementations§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<FormatError> for Error
Available on crate feature std only.
impl From<FormatError> for Error
std only.