pub trait AsRange: Sized {
type Item: Measure + PartialEnum;
// Required methods
fn start(&self) -> Bound<&Self::Item>;
fn end(&self) -> Bound<&Self::Item>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn intersects<R: AsRange>(&self, other: &R) -> bool
where Self::Item: PartialOrd<R::Item> + Measure<R::Item> { ... }
fn connected_to<R: AsRange>(&self, other: &R) -> bool
where Self::Item: PartialOrd<R::Item> + Measure<R::Item> { ... }
fn intersected_with<'a, R: AsRange<Item = Self::Item>>(
&'a self,
other: &'a R,
) -> AnyRange<&'a Self::Item>
where Self::Item: PartialOrd + Measure { ... }
fn without<'a, R: AsRange<Item = Self::Item>>(
&'a self,
other: &'a R,
) -> Difference<&'a Self::Item>
where Self::Item: PartialOrd + Measure { ... }
fn product<'a, R: AsRange<Item = Self::Item>>(
&'a self,
other: &'a R,
) -> Product<&'a Self::Item>
where Self::Item: PartialOrd + Measure { ... }
}Expand description
Types that can be interpreted as ranges.
Required Associated Types§
Sourcetype Item: Measure + PartialEnum
type Item: Measure + PartialEnum
Type of the elements of the range.
Required Methods§
Provided Methods§
fn is_empty(&self) -> bool
fn intersects<R: AsRange>(&self, other: &R) -> bool
fn connected_to<R: AsRange>(&self, other: &R) -> bool
fn intersected_with<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> AnyRange<&'a Self::Item>
fn without<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> Difference<&'a Self::Item>
fn product<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> Product<&'a Self::Item>
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.