pub trait Range<Idx: Clone + Ord = usize> {
// Required methods
fn start(&self) -> Idx;
fn end(&self) -> Idx;
// Provided methods
fn clamp(&self, start: impl Into<Idx>, end: impl Into<Idx>) -> Range<Idx> { ... }
fn clamp_left(&self, start: impl Into<Idx>) -> Range<Idx> { ... }
fn clamp_right(&self, end: impl Into<Idx>) -> Range<Idx> { ... }
fn intersection<T, R>(&self, other: R) -> Range<Idx>
where T: Clone + Ord + Into<Idx>,
R: Range<T> { ... }
fn to_open_range(&self) -> OpenRange<Idx> { ... }
}Required Methods§
Provided Methods§
fn clamp(&self, start: impl Into<Idx>, end: impl Into<Idx>) -> Range<Idx>
fn clamp_left(&self, start: impl Into<Idx>) -> Range<Idx>
fn clamp_right(&self, end: impl Into<Idx>) -> Range<Idx>
fn intersection<T, R>(&self, other: R) -> Range<Idx>
fn to_open_range(&self) -> OpenRange<Idx>
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.