Struct mm0_util::Span [−][src]
Points to a specific region of a source file by identifying the region’s start and end points.
Fields
start: usize
The byte index of the beginning of the span (inclusive).
end: usize
The byte index of the end of the span (exclusive).
Methods from Deref<Target = Range<usize>>
pub fn contains<U>(&self, item: &U) -> bool where
Idx: PartialOrd<U>,
U: PartialOrd<Idx> + ?Sized,
1.35.0[src]
Idx: PartialOrd<U>,
U: PartialOrd<Idx> + ?Sized,
Returns true
if item
is contained in the range.
Examples
assert!(!(3..5).contains(&2)); assert!( (3..5).contains(&3)); assert!( (3..5).contains(&4)); assert!(!(3..5).contains(&5)); assert!(!(3..3).contains(&3)); assert!(!(3..2).contains(&3)); assert!( (0.0..1.0).contains(&0.5)); assert!(!(0.0..1.0).contains(&f32::NAN)); assert!(!(0.0..f32::NAN).contains(&0.5)); assert!(!(f32::NAN..1.0).contains(&0.5));
pub fn is_empty(&self) -> bool
1.47.0[src]
Returns true
if the range contains no items.
Examples
assert!(!(3..5).is_empty()); assert!( (3..3).is_empty()); assert!( (3..2).is_empty());
The range is empty if either side is incomparable:
assert!(!(3.0..5.0).is_empty()); assert!( (3.0..f32::NAN).is_empty()); assert!( (f32::NAN..5.0).is_empty());
Trait Implementations
impl DeepSizeOf for Span
[src]
impl DeepSizeOf for Span
[src]fn deep_size_of_children(&self, _: &mut Context) -> usize
[src]
pub fn deep_size_of(&self) -> usize
[src]
pub fn deep_size_of_with(&self, context: &mut Context) -> usize
[src]
impl From<RangeInclusive<usize>> for Span
[src]
impl From<RangeInclusive<usize>> for Span
[src]fn from(r: RangeInclusive<usize>) -> Self
[src]
impl Index<Span> for LinedString
[src]
impl Index<Span> for LinedString
[src]Allows LinedString
to be indexed with a Span
, since Span
is essentially a range.
impl IntoIterator for Span
[src]
impl IntoIterator for Span
[src]impl StructuralEq for Span
[src]
impl StructuralEq for Span
[src]impl StructuralPartialEq for Span
[src]
impl StructuralPartialEq for Span
[src]Auto Trait Implementations
impl RefUnwindSafe for Span
impl RefUnwindSafe for Span
impl UnwindSafe for Span
impl UnwindSafe for Span