pub enum RangeRelation<T> {
Before(T),
Overlap(T),
After(T),
Last(T),
Invalid(T),
}Expand description
This enum is used to represent positional relationships between 2 ranges.
- before a range: RangeRelation::Before
- overlap with a range: RangeRelation::Overlap
- after a range: RangeRelation::Overlap
The additional states, represent the initialization of the set.
- empty or no data: RangeRelation::Invalid
- last or final: RangeRelation::Last
Variants§
Before(T)
Range a is before range b
Overlap(T)
Range a and b overlap
After(T)
Range a is after range b
Last(T)
Represents final set of data
Invalid(T)
Denotes a was not valid
Implementations§
Source§impl<T> RangeRelation<T>
impl<T> RangeRelation<T>
Sourcepub fn invalid(self) -> T
pub fn invalid(self) -> T
Unwraps the state of RangeRelation::Invalid or panics!.
Sourcepub fn last(self) -> T
pub fn last(self) -> T
Unwraps the state of RangeRelation::Last or panics!
Sourcepub fn before(self) -> T
pub fn before(self) -> T
Unwraps the state of RangeRelation::Before or panics!
Sourcepub fn overlap(self) -> T
pub fn overlap(self) -> T
Unwraps the state of RangeRelation::Overlap or panics!
Sourcepub fn after(self) -> T
pub fn after(self) -> T
Unwraps the state of RangeRelation::After or panics!
Sourcepub fn is_last(&self) -> bool
pub fn is_last(&self) -> bool
Returns true if RangeRelation::Last.
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Returns true if RangeRelation::Invalid.
Sourcepub fn is_overlap(&self) -> bool
pub fn is_overlap(&self) -> bool
Returns true if RangeRelation::Overlap.
Sourcepub fn is_before(&self) -> bool
pub fn is_before(&self) -> bool
Returns true if RangeRelation::Before.
Sourcepub fn is_after(&self) -> bool
pub fn is_after(&self) -> bool
Returns true if RangeRelation::After.
Auto Trait Implementations§
impl<T> Freeze for RangeRelation<T>where
T: Freeze,
impl<T> RefUnwindSafe for RangeRelation<T>where
T: RefUnwindSafe,
impl<T> Send for RangeRelation<T>where
T: Send,
impl<T> Sync for RangeRelation<T>where
T: Sync,
impl<T> Unpin for RangeRelation<T>where
T: Unpin,
impl<T> UnsafeUnpin for RangeRelation<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RangeRelation<T>where
T: UnwindSafe,
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