#[non_exhaustive]pub enum MatError {
Show 13 variants
Hdf5(Error),
Format(FormatError),
Io(Error),
RootMustBeStruct,
UnsupportedType(&'static str),
MixedSequenceElementTypes,
RaggedMatrix {
expected: usize,
got: usize,
},
ShapeMismatch {
expected: String,
actual: String,
},
MissingField(String),
UnknownClass(String),
UnsupportedMatlabClass(String),
Utf16Decode(String),
Custom(String),
}Expand description
Errors that can occur when (de)serializing .mat v7.3 files.
Marked #[non_exhaustive]: reading MATLAB’s MCOS opaque classes is an
ongoing effort (datetime, categorical, table, containers.Map,
dictionary, …), and each newly decoded — or newly refused — class can
introduce a more specific error variant. Keeping the enum open lets those
additions land without a breaking change, so downstream matches must
include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Hdf5(Error)
Underlying HDF5 I/O or format error.
Format(FormatError)
Underlying HDF5 format parse error.
Io(Error)
I/O error when reading or writing a file path.
RootMustBeStruct
Top-level must be a struct with named fields (each field becomes a MATLAB variable).
UnsupportedType(&'static str)
The requested Rust type has no MATLAB v7.3 encoding in this crate.
MixedSequenceElementTypes
A sequence contained elements of different primitive types.
RaggedMatrix
A 2-D matrix had inconsistent row lengths.
ShapeMismatch
A dataset’s on-disk shape didn’t match the Rust type.
MissingField(String)
A required struct field was missing from the file.
UnknownClass(String)
A MATLAB_class attribute value wasn’t recognized.
UnsupportedMatlabClass(String)
A recognized but not-yet-supported MATLAB class was encountered on read
— an MCOS opaque class (datetime, categorical, table,
containers.Map, dictionary, an enumeration, a user classdef, …)
whose decoder is not yet implemented. Refused by name rather than
misread; the modern string class is supported.
Utf16Decode(String)
UTF-16 decoding of a char dataset failed.
Custom(String)
A generic serde-originated error (from Error::custom).
Trait Implementations§
Source§impl Error for MatError
impl Error for MatError
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()