pub enum Error {
SizeOverflow,
SizeMismatch,
CapacityOverflow,
LengthInconsistent,
IndexOutOfBounds,
SquareMatrixRequired,
ShapeNotConformable,
}
Expand description
An enum for error types.
Variants§
SizeOverflow
Error when matrix size exceeds usize::MAX
, which is, in fact
pointless, since a matrix can only store up to isize::MAX
bytes
of data.
SizeMismatch
Error when the size of the shape does not match the length of the underlying data.
Ensuring this equality is crucial because if the size exceeds the length, indexing into the matrix may result in out-of-bounds memory access, leading to undefined behavior.
CapacityOverflow
Error when the capacity exceeds isize::MAX
.
Refer to Vec::with_capacity
for more information.
LengthInconsistent
Error when creating a matrix from a sequence of vectors with inconsistent lengths.
IndexOutOfBounds
Error for accessing an index out of bounds.
SquareMatrixRequired
Error when a square matrix is required but the current one does not satisfy this requirement.
ShapeNotConformable
Error when the shapes of two matrices are not conformable for the intended operation.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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