pub type Result<T> = core::result::Result<T, Error>;
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
#[non_exhaustive]
pub enum Error {
SizeOverflow,
SizeMismatch,
CapacityOverflow,
LengthInconsistent,
IndexOutOfBounds,
ShapeNotConformable,
}
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let content = match self {
Self::SizeOverflow => "size overflow",
Self::SizeMismatch => "size mismatch",
Self::CapacityOverflow => "capacity overflow",
Self::LengthInconsistent => "length inconsistent",
Self::IndexOutOfBounds => "index out of bounds",
Self::ShapeNotConformable => "shape not conformable",
};
f.write_str(content)
}
}
impl core::error::Error for Error {}