Struct litcheck_core::range::Range
source · pub struct Range<T> {
pub start: T,
pub end: T,
}
Fields§
§start: T
§end: T
Implementations§
source§impl<T: PartialOrd> Range<T>
impl<T: PartialOrd> Range<T>
source§impl<T: NumericRangeBound> Range<T>
impl<T: NumericRangeBound> Range<T>
pub fn len(&self) -> T
sourcepub fn pop_front(&mut self) -> Option<T>
pub fn pop_front(&mut self) -> Option<T>
Shrink the length of this range by one element from the front, returning the first item in the range.
sourcepub fn pop_back(&mut self) -> Option<T>
pub fn pop_back(&mut self) -> Option<T>
Shrink the length of this range by one element from the end, returning the last item in the range.
sourcepub fn shrink_front(&mut self, n: T)
pub fn shrink_front(&mut self, n: T)
Shrink this range by advancing the start of the range n
elements, i.e. (start + n)..end
NOTE: This function will saturate to self.end
to ensure the range remains valid.
Trait Implementations§
source§impl From<SourceSpan> for Range<usize>
impl From<SourceSpan> for Range<usize>
source§fn from(span: SourceSpan) -> Self
fn from(span: SourceSpan) -> Self
Converts to this type from the input type.
source§impl<T: Ord> Ord for Range<T>
impl<T: Ord> Ord for Range<T>
source§impl<T: PartialEq> PartialEq for Range<T>
impl<T: PartialEq> PartialEq for Range<T>
source§impl<T: PartialOrd> PartialOrd for Range<T>
impl<T: PartialOrd> PartialOrd for Range<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> RangeBounds<T> for Range<T>
impl<T> RangeBounds<T> for Range<T>
impl<T: Copy> Copy for Range<T>
impl<T: Eq> Eq for Range<T>
Auto Trait Implementations§
impl<T> Freeze for Range<T>where
T: Freeze,
impl<T> RefUnwindSafe for Range<T>where
T: RefUnwindSafe,
impl<T> Send for Range<T>where
T: Send,
impl<T> Sync for Range<T>where
T: Sync,
impl<T> Unpin for Range<T>where
T: Unpin,
impl<T> UnwindSafe for Range<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more