pub enum Overlap {
Less,
Greater,
Equal,
Narrow,
Wide,
WideLess,
WideGreater,
}Expand description
Variants§
Less
A lack of overlap where the compared range is entirely less than another
Greater
A lack of overlap where the compared range is entirely greater than another
Equal
An overlap where the compared range is identical to another
Narrow
An overlap where the compared range is narrower than another
Wide
An overlap where the compared range is wider than another on both sides
WideLess
An overlap where the compared range is wider than another with a lesser start and end point
WideGreater
An overlap where the compared range is wider than another with a greater start and end point
Implementations§
Source§impl Overlap
impl Overlap
Sourcepub fn then(self, other: Self) -> Self
pub fn then(self, other: Self) -> Self
Return the narrowest Overlap which contains both self and other.
Examples:
use collate::Overlap;
assert_eq!(Overlap::Narrow.then(Overlap::Less), Overlap::WideLess);
assert_eq!(Overlap::WideLess.then(Overlap::WideGreater), Overlap::Wide);
assert_eq!(Overlap::Less.then(Overlap::Greater), Overlap::Wide);
assert_eq!(Overlap::Less.then(Overlap::Less), Overlap::Less);Trait Implementations§
Source§impl PartialOrd for Overlap
impl PartialOrd for Overlap
impl Copy for Overlap
impl Eq for Overlap
impl StructuralPartialEq for Overlap
Auto Trait Implementations§
impl Freeze for Overlap
impl RefUnwindSafe for Overlap
impl Send for Overlap
impl Sync for Overlap
impl Unpin for Overlap
impl UnwindSafe for Overlap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more