pub enum DataFormatErrorKind {
CsvReadError {
dataset_name: String,
error: String,
},
InvalidColumnCount {
dataset_name: String,
expected: usize,
actual: usize,
line_num: usize,
line: String,
},
ParseFailed {
dataset_name: String,
field_name: String,
line_num: usize,
line: String,
error: String,
},
InvalidValue {
dataset_name: String,
field_name: String,
value: String,
line_num: usize,
line: String,
},
LengthMismatch {
dataset_name: String,
field_name: String,
expected: usize,
actual: usize,
},
EmptyDataset {
dataset_name: String,
},
ArrayShapeError {
dataset_name: String,
array_name: String,
error: String,
},
}Expand description
Specific kinds of data format errors that can occur during dataset parsing.
§Variants
CsvReadError- Failed to read a CSV record.InvalidColumnCount- The row has an unexpected number of columns.ParseFailed- Failed to parse a field value into the target type.InvalidValue- The field value is syntactically valid but semantically incorrect.LengthMismatch- The total parsed data length doesn’t match expected dimensions.EmptyDataset- The dataset is empty.ArrayShapeError- Failed to construct ndarray with the given shape and data.
Variants§
CsvReadError
Failed to read a CSV record
InvalidColumnCount
The row has an unexpected number of columns
Fields
ParseFailed
Failed to parse a field value into the target type
Fields
InvalidValue
The field value is syntactically valid but semantically incorrect
Fields
LengthMismatch
The total parsed data length doesn’t match expected dimensions
Fields
EmptyDataset
The dataset is empty
ArrayShapeError
Failed to construct ndarray with the given shape and data
Trait Implementations§
Source§impl Debug for DataFormatErrorKind
impl Debug for DataFormatErrorKind
Source§impl Display for DataFormatErrorKind
impl Display for DataFormatErrorKind
Source§impl Error for DataFormatErrorKind
impl Error for DataFormatErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DataFormatErrorKind> for DatasetError
impl From<DataFormatErrorKind> for DatasetError
Source§fn from(source: DataFormatErrorKind) -> Self
fn from(source: DataFormatErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DataFormatErrorKind
impl RefUnwindSafe for DataFormatErrorKind
impl Send for DataFormatErrorKind
impl Sync for DataFormatErrorKind
impl Unpin for DataFormatErrorKind
impl UnsafeUnpin for DataFormatErrorKind
impl UnwindSafe for DataFormatErrorKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more