pub trait RangeExt<T> {
// Required methods
fn in_range(&self, outer: &Range<T>) -> bool;
fn intersects(&self, other: &Range<T>) -> bool;
fn intersect(&self, other: &Range<T>) -> Option<Range<T>>;
fn trim(&self, trim_to_len: T) -> Option<Range<T>>;
}Expand description
Extension trait providing range-checking methods directly on Range<T>.
Required Methods§
Sourcefn in_range(&self, outer: &Range<T>) -> bool
fn in_range(&self, outer: &Range<T>) -> bool
Returns true if this range is fully contained inside outer.
Sourcefn intersects(&self, other: &Range<T>) -> bool
fn intersects(&self, other: &Range<T>) -> bool
Returns true if this range overlaps with other.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".