1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use super::Ex3Uint;
use crate::impl_compare_unit_for;
use candid::Nat;
use num_bigint::BigUint;

impl_compare_unit_for!(Ex3Uint, u8, u16, u32, u64, u128, usize);

impl PartialEq<BigUint> for Ex3Uint {
    fn eq(&self, other: &BigUint) -> bool {
        self.0 == *other
    }
}

impl PartialOrd<BigUint> for Ex3Uint {
    fn partial_cmp(&self, other: &BigUint) -> Option<std::cmp::Ordering> {
        self.0.partial_cmp(other)
    }
}

impl PartialEq<Ex3Uint> for BigUint {
    fn eq(&self, other: &Ex3Uint) -> bool {
        *self == other.0
    }
}

impl PartialOrd<Ex3Uint> for BigUint {
    fn partial_cmp(&self, other: &Ex3Uint) -> Option<std::cmp::Ordering> {
        self.partial_cmp(&other.0)
    }
}

impl PartialEq<Nat> for Ex3Uint {
    fn eq(&self, other: &Nat) -> bool {
        self.0 == other.0
    }
}

impl PartialOrd<Nat> for Ex3Uint {
    fn partial_cmp(&self, other: &Nat) -> Option<std::cmp::Ordering> {
        self.0.partial_cmp(&other.0)
    }
}

impl PartialEq<Ex3Uint> for Nat {
    fn eq(&self, other: &Ex3Uint) -> bool {
        self.0 == other.0
    }
}

impl PartialOrd<Ex3Uint> for Nat {
    fn partial_cmp(&self, other: &Ex3Uint) -> Option<std::cmp::Ordering> {
        self.0.partial_cmp(&other.0)
    }
}