1mod partial_eq_private { pub trait Sealed<Lhs: ?Sized, Rhs: ?Sized> { } }
4
5pub trait IsntPartialEqExt<Lhs: ?Sized, Rhs: ?Sized>: partial_eq_private::Sealed<Lhs, Rhs>+std::cmp::PartialEq<Rhs> {
7 #[must_use]
9 fn not_eq(&self, other: &Rhs) -> bool;
10 #[must_use]
12 fn not_ne(&self, other: &Rhs) -> bool;
13}
14
15impl<Lhs: ?Sized, Rhs: ?Sized> partial_eq_private::Sealed<Lhs, Rhs> for Lhs where Lhs: std::cmp::PartialEq<Rhs> { }
16
17impl<Lhs: ?Sized, Rhs: ?Sized> IsntPartialEqExt<Lhs, Rhs> for Lhs where Lhs: std::cmp::PartialEq<Rhs> {
18 #[inline]
19 fn not_eq(&self, other: &Rhs) -> bool {
20 !self.eq(other)
21 }
22
23 #[inline]
24 fn not_ne(&self, other: &Rhs) -> bool {
25 !self.ne(other)
26 }
27}
28
29mod partial_ord_private { pub trait Sealed<Lhs: ?Sized, Rhs: ?Sized> { } }
30
31pub trait IsntPartialOrdExt<Lhs: ?Sized, Rhs: ?Sized>: partial_ord_private::Sealed<Lhs, Rhs>+std::cmp::PartialOrd<Rhs> {
33 #[must_use]
35 fn not_lt(&self, other: &Rhs) -> bool;
36 #[must_use]
38 fn not_le(&self, other: &Rhs) -> bool;
39 #[must_use]
41 fn not_gt(&self, other: &Rhs) -> bool;
42 #[must_use]
44 fn not_ge(&self, other: &Rhs) -> bool;
45}
46
47impl<Lhs: ?Sized, Rhs: ?Sized> partial_ord_private::Sealed<Lhs, Rhs> for Lhs where Lhs: std::cmp::PartialOrd<Rhs> { }
48
49impl<Lhs: ?Sized, Rhs: ?Sized> IsntPartialOrdExt<Lhs, Rhs> for Lhs where Lhs: std::cmp::PartialOrd<Rhs> {
50 #[inline]
51 fn not_lt(&self, other: &Rhs) -> bool {
52 !self.lt(other)
53 }
54
55 #[inline]
56 fn not_le(&self, other: &Rhs) -> bool {
57 !self.le(other)
58 }
59
60 #[inline]
61 fn not_gt(&self, other: &Rhs) -> bool {
62 !self.gt(other)
63 }
64
65 #[inline]
66 fn not_ge(&self, other: &Rhs) -> bool {
67 !self.ge(other)
68 }
69}