#[non_exhaustive]pub enum MattenError {
Shape {
operation: &'static str,
message: String,
},
Broadcast {
left: Vec<usize>,
right: Vec<usize>,
},
Allocation {
requested_elements: usize,
message: String,
},
Slice {
input: Option<String>,
message: String,
},
Parse {
format: DataFormat,
message: String,
},
Io {
path: PathBuf,
source: Error,
},
Unsupported {
operation: &'static str,
message: String,
},
}Expand description
The single public error type for matten.
The variant set is canonical (RFC-005). It derives only Debug; it is not
Clone, PartialEq, or Eq. Tests should match by variant, e.g.
matches!(err, MattenError::Shape { .. }).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Shape
Invalid shape, length mismatch, or a constructor argument (such as an
arange step / finite bound) that determines the produced tensor shape.
Fields
Broadcast
Two shapes could not be broadcast together (never folded into Shape).
Allocation
A shape product overflowed or an allocation exceeded a safety limit.
Fields
Slice
A slice specification (builder or slice_str) was invalid.
Fields
Parse
A data-format parse error (JSON or CSV). Row/column context, when
available, is carried inside message.
Fields
format: DataFormatWhich data format produced the error.
Io
A file I/O error while loading data.
Unsupported
An operation or input is not supported in this build or phase (for example, a feature-gated capability that is disabled).
Trait Implementations§
Source§impl Debug for MattenError
impl Debug for MattenError
Source§impl Display for MattenError
impl Display for MattenError
Source§impl Error for MattenError
impl Error for MattenError
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()