inter_val/
traits.rs

1use crate::BoundType;
2
3pub trait Flip {
4    type Flip: Flip<Flip = Self>;
5    fn flip(self) -> Self::Flip;
6}
7
8pub(crate) trait IntoGeneral {
9    type General;
10    fn into_general(self) -> Self::General;
11}
12
13pub trait Boundary: Flip + Eq + PartialEq<BoundType> + Copy {
14    fn less<T: PartialOrd>(&self, this: &T, t: &T) -> bool;
15
16    fn is_inclusive(&self) -> bool {
17        *self == BoundType::Inclusive
18    }
19    fn is_exclusive(&self) -> bool {
20        *self == BoundType::Exclusive
21    }
22}
23
24pub trait BoundaryOf<LR>: Boundary {
25    type Ordered: Ord;
26    fn into_ordered(self) -> Self::Ordered;
27}