#[derive(Debug, Copy,Clone,PartialEq,Eq,Hash,PartialOrd,Ord)]
pub enum TryIndicesError {
IndexOutOfBounds,
DuplicateIndex,
}
impl std::error::Error for TryIndicesError{}
impl core::fmt::Display for TryIndicesError {
#[inline]
fn fmt(&self,f: &mut core::fmt::Formatter) -> core::fmt::Result {
let variant_name = match*self {
TryIndicesError::IndexOutOfBounds => "TryIndicesError::IndexOutOfBounds",
TryIndicesError::DuplicateIndex => "TryIndicesError::DuplicateIndex",
};
write!(f, "{}", variant_name)
}
}
#[derive(Debug, Copy,Clone,PartialEq,Eq,Hash,PartialOrd,Ord)]
pub enum TryIndicesOrderedError {
IndexOutOfBounds,
InvalidIndex,
}
impl std::error::Error for TryIndicesOrderedError{}
impl core::fmt::Display for TryIndicesOrderedError {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
let variant_name = match *self {
TryIndicesOrderedError::IndexOutOfBounds => "TryIndicesOrderedError::IndexOutOfBounds",
TryIndicesOrderedError::InvalidIndex => "TryIndicesOrderedError::InvalidIndex",
};
write!(f, "{}", variant_name)
}
}