Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 18 variants Io(Error), Format(FormatError), NotADataset(String), MissingMessage(MessageType), AlignmentError(String), Shape(String), SwmrUnsupported, HandlesOutstanding, ReadOnly, FileClosed, SwmrStagedUnsupported, SwmrAppendUnsupported(&'static str), AppendUnsupported(&'static str), AppendInPlaceUnsupported(&'static str), EditUnsupported(&'static str), RepackUnsupported(String), FileLocked(String), FileMarkedInUse(String),
}
Expand description

Errors that can occur when using the high-level API.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

§

HandlesOutstanding

An operation that needs exclusive access to the open file (e.g. crate::File::refresh) was requested while owned crate::Dataset / crate::Group handles, or a clone of the crate::File, are still alive. Drop them and retry.

§

ReadOnly

A write (e.g. crate::Dataset::append) was requested on a file opened read-only. Open it with crate::File::open_rw to modify it in place.

§

FileClosed

A write was requested through a handle whose crate::File has already been sealed by crate::File::close. Immediate and staged edits are refused; reads through surviving handles still work. Re-open the file to modify it again.

§

SwmrStagedUnsupported

A staged edit (write / set_attr / create_* / delete / copy / commit) was requested on a file opened with crate::File::open_swmr_writer, which permits only immediate crate::Dataset::append. Committing a structural edit would clear the SWMR-write flag out from under a concurrent reader, so the whole staged surface is refused in SWMR-writer mode.

§

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.

§

AppendUnsupported(&'static str)

The dataset is not a supported target for Dataset::append_staged — for example a dataset that is not chunked, not extensible along its first dimension, not indexed by an Extensible Array, higher than rank 1, uses a filter this engine cannot re-encode, has a big-endian on-disk element datatype (for a raw append), or has more than one hard link. The payload is a human-readable reason.

§

AppendInPlaceUnsupported(&'static str)

The dataset or file is not a supported target for the fast, immediate in-place append (Dataset::append) — for example a userblock or non-latest-format file, a dataset whose Extensible-Array index is not yet allocated, one that is not rank-1 / unlimited / Extensible-Array indexed, one reachable through more than one hard link, or a path an uncommitted staged edit in the same session will relocate or delete. Distinct from AppendUnsupported so a caller can catch this fast-path refusal and fall back to the staged Dataset::append_staged. 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::File::open_rw) — 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::File::open_swmr_writer, crate::File::open_rw) 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.

§

FileMarkedInUse(String)

The file could not be opened because its superblock’s status-flags byte marks it as held by a writer — the durable flag crate::File::open_swmr_writer raises, and the reference C library raises for any writer. Unlike FileLocked this outlives the process that set it, so it means either that a writer is active or that one exited without clearing it; the payload names crate::File::clear_swmr_flag (the h5clear -s equivalent) as the recovery for the latter. A live SWMR writer can still be followed with crate::File::open_swmr. The payload is a human-readable reason.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Available on crate feature std only.
Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Available on crate feature std only.
Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Available on crate feature std only.
Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for MatError

Source§

fn from(e: Hdf5Error) -> Self

Converts to this type from the input type.
Source§

impl From<FormatError> for Error

Available on crate feature std only.
Source§

fn from(e: FormatError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.