pub trait RangeStart<Idx = usize> {
// Required method
fn start(&self) -> Idx;
}Expand description
A range with a defined inclusive lower bound.
This is the shared base of the crate’s extension traits. The
implementations for
std::ops::RangeTo, std::ops::RangeToInclusive,
std::ops::RangeFull, and None anchor the start at
Idx::zero(); for a signed index type the negative portion
is not represented, so (..-5) reports itself empty.
For std::ops::RangeInclusive, the inherent start method shadows this
one; call it as RangeStart::start(&range).
§Examples
use ps_range::RangeStart;
assert_eq!((2..8).start(), 2);
assert_eq!((..8).start(), 0);
assert_eq!(RangeStart::start(&(2..=8)), 2);Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".