use std::cmp::Ordering;
#[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq)]
pub enum HasIonMobility {
#[default]
None = 0,
Point = 1,
Dimension = 2
}
impl PartialOrd for HasIonMobility {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for HasIonMobility {
fn cmp(&self, other: &Self) -> Ordering {
match self {
HasIonMobility::None => {
match other {
HasIonMobility::None => Ordering::Equal,
_ => Ordering::Less
}
},
HasIonMobility::Point => {
match other {
HasIonMobility::None => Ordering::Greater,
HasIonMobility::Point => Ordering::Equal,
HasIonMobility::Dimension => Ordering::Less,
}
},
HasIonMobility::Dimension => {
match other {
HasIonMobility::Dimension => Ordering::Equal,
_ => Ordering::Greater
}
},
}
}
}