pub enum Error {
Show 38 variants
UnexpectedDType {
msg: &'static str,
expected: DType,
got: DType,
},
DTypeMismatchBinaryOp {
lhs: DType,
rhs: DType,
op: &'static str,
},
UnsupportedDTypeForOp(DType, &'static str),
IndexOutOfRangeTake {
storage_len: usize,
index: usize,
},
IndexOutOfRange {
max_size: usize,
index: usize,
op: &'static str,
},
DimOutOfRange {
shape: Shape,
dim: i32,
op: &'static str,
},
DuplicateDimIndex {
shape: Shape,
dims: Vec<usize>,
op: &'static str,
},
RepeatRankOutOfRange {
repeats: Shape,
shape: Shape,
},
ElementSizeMismatch {
expected: usize,
got: usize,
op: &'static str,
},
UnexpectedNumberOfDims {
expected: usize,
got: usize,
shape: Shape,
},
UnexpectedShape {
msg: String,
expected: Shape,
got: Shape,
},
ShapeMismatchBinaryOp {
lhs: Shape,
rhs: Shape,
op: &'static str,
},
ShapeMismatchCat {
dim: usize,
first_shape: Shape,
n: usize,
nth_shape: Shape,
},
ShapeMismatchFilter {
src: Shape,
condition: Shape,
},
ShapeMismatchSelect {
mask: Shape,
who: &'static str,
},
ShapeMismatchCopyFrom {
dst: Shape,
src: Shape,
},
NarrowRangeInvalidArgs {
shape: Shape,
dim: usize,
range: Range,
msg: &'static str,
},
NarrowInvalidArgs {
shape: Shape,
dim: usize,
start: usize,
len: usize,
msg: &'static str,
},
SqueezeDimNot1 {
shape: Shape,
dim: usize,
},
BroadcastIncompatibleShapes {
src_shape: Shape,
dst_shape: Shape,
},
OpRequiresAtLeastOneNdArray {
op: &'static str,
},
Rand(String),
NotScalar,
LenMismatchVector {
lhs: usize,
rhs: usize,
op: &'static str,
},
ShapeMismatchMatrix {
lhs: (usize, usize),
rhs: (usize, usize),
op: &'static str,
},
VectorIndexOutOfRange {
len: usize,
index: usize,
},
MatrixIndexOutOfRange {
len: usize,
index: usize,
position: &'static str,
},
Linalg(LinalgError),
Npy(NpyError),
Nrst(NrstError),
ParseInt(ParseIntError),
FromUtf8(FromUtf8Error),
Io(Error),
Utf8(Utf8Error),
Zip(ZipError),
Context {
inner: Box<Self>,
context: String,
},
Msg(String),
UnwrapNone,
}Variants§
UnexpectedDType
DTypeMismatchBinaryOp
UnsupportedDTypeForOp(DType, &'static str)
IndexOutOfRangeTake
IndexOutOfRange
DimOutOfRange
DuplicateDimIndex
RepeatRankOutOfRange
ElementSizeMismatch
UnexpectedNumberOfDims
UnexpectedShape
ShapeMismatchBinaryOp
ShapeMismatchCat
ShapeMismatchFilter
ShapeMismatchSelect
ShapeMismatchCopyFrom
NarrowRangeInvalidArgs
NarrowInvalidArgs
SqueezeDimNot1
BroadcastIncompatibleShapes
OpRequiresAtLeastOneNdArray
Rand(String)
NotScalar
LenMismatchVector
ShapeMismatchMatrix
VectorIndexOutOfRange
MatrixIndexOutOfRange
Linalg(LinalgError)
Npy(NpyError)
Nrst(NrstError)
ParseInt(ParseIntError)
Integer parse error.
FromUtf8(FromUtf8Error)
Utf8 parse error.
Io(Error)
I/O error.
Utf8(Utf8Error)
Zip(ZipError)
Context
Msg(String)
User generated error message
UnwrapNone
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<LinalgError> for Error
impl From<LinalgError> for Error
Source§fn from(source: LinalgError) -> Self
fn from(source: LinalgError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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