pub trait RangeOps<T>: RangeBounds<T> {
// Required methods
fn is_empty(&self) -> bool;
fn is_disjoint_from(&self, other: &impl RangeBounds<T>) -> bool;
fn intersects(&self, other: &impl RangeBounds<T>) -> bool;
fn is_before(&self, other: &impl RangeBounds<T>) -> bool;
fn is_after(&self, other: &impl RangeBounds<T>) -> bool;
fn begins_within(&self, other: &impl RangeBounds<T>) -> bool;
fn ends_within(&self, other: &impl RangeBounds<T>) -> bool;
fn contains_range(&self, other: &impl RangeBounds<T>) -> bool;
fn is_contained_by(&self, other: &impl RangeBounds<T>) -> bool;
}
Expand description
Convenient interval comparisons.
Required Methods§
Sourcefn is_disjoint_from(&self, other: &impl RangeBounds<T>) -> bool
fn is_disjoint_from(&self, other: &impl RangeBounds<T>) -> bool
Checks if an interval has no overlap with another.
Sourcefn intersects(&self, other: &impl RangeBounds<T>) -> bool
fn intersects(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval has some overlap with another.
Sourcefn is_before(&self, other: &impl RangeBounds<T>) -> bool
fn is_before(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval ends before the start of another.
Sourcefn is_after(&self, other: &impl RangeBounds<T>) -> bool
fn is_after(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval starts after the end of another.
Sourcefn begins_within(&self, other: &impl RangeBounds<T>) -> bool
fn begins_within(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval starts within another.
Sourcefn ends_within(&self, other: &impl RangeBounds<T>) -> bool
fn ends_within(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval ends within another.
Sourcefn contains_range(&self, other: &impl RangeBounds<T>) -> bool
fn contains_range(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval contains another.
Sourcefn is_contained_by(&self, other: &impl RangeBounds<T>) -> bool
fn is_contained_by(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval is contained by another.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.