1use std::cmp::Ordering;
2
3#[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq)]
5pub enum HasIonMobility {
6 #[default]
8 None = 0,
9 Point = 1,
11 Dimension = 2
13}
14
15impl PartialOrd for HasIonMobility {
16 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
17 Some(self.cmp(other))
18 }
19}
20
21impl Ord for HasIonMobility {
22 fn cmp(&self, other: &Self) -> Ordering {
23 match self {
24 HasIonMobility::None => {
25 match other {
26 HasIonMobility::None => Ordering::Equal,
27 _ => Ordering::Less
28 }
29 },
30 HasIonMobility::Point => {
31 match other {
32 HasIonMobility::None => Ordering::Greater,
33 HasIonMobility::Point => Ordering::Equal,
34 HasIonMobility::Dimension => Ordering::Less,
35 }
36 },
37 HasIonMobility::Dimension => {
38 match other {
39 HasIonMobility::Dimension => Ordering::Equal,
40 _ => Ordering::Greater
41 }
42 },
43 }
44 }
45}