pub struct RangeFrom<Idx> {
pub start: Idx,
}Expand description
A range only bounded inclusively below (start..).
The RangeFrom start.. contains all values with x >= start.
Note: Overflow in the Iterator implementation (when the contained
data type reaches its numerical limit) is allowed to panic, wrap, or
saturate. This behavior is defined by the implementation of the Step
trait. For primitive integers, this follows the normal rules, and respects
the overflow checks profile (panic in debug, wrap in release). Note also
that overflow happens earlier than you might assume: the overflow happens
in the call to next that yields the maximum value, as the range must be
set to a state to yield the next value.
§Examples
The start.. syntax is a RangeFrom:
Fields§
§start: IdxThe lower bound of the range (inclusive).
Trait Implementations§
Source§impl<T> IntoBounds<T> for RangeFrom<T>
impl<T> IntoBounds<T> for RangeFrom<T>
Source§impl<T> OneSidedRange<T> for RangeFrom<T>where
Self: RangeBounds<T>,
impl<T> OneSidedRange<T> for RangeFrom<T>where
Self: RangeBounds<T>,
Source§fn bound(self) -> (OneSidedRangeBound, T)
fn bound(self) -> (OneSidedRangeBound, T)
one_sided_range #69780)split_off and
split_off_mut that returns the bound of the one-sided range.1.28.0 (const: unstable) · Source§impl<T> RangeBounds<T> for RangeFrom<&T>
If you need to use this implementation where T is unsized,
consider using the RangeBounds impl for a 2-tuple of Bound<&T>,
i.e. replace start.. with (Bound::Included(start), Bound::Unbounded).
impl<T> RangeBounds<T> for RangeFrom<&T>
If you need to use this implementation where T is unsized,
consider using the RangeBounds impl for a 2-tuple of Bound<&T>,
i.e. replace start.. with (Bound::Included(start), Bound::Unbounded).
1.28.0 (const: unstable) · Source§impl<T> RangeBounds<T> for RangeFrom<T>
impl<T> RangeBounds<T> for RangeFrom<T>
1.15.0 (const: unstable) · Source§impl<T> SliceIndex<[T]> for RangeFrom<usize>
The methods index and index_mut panic if the start of the range is out of bounds.
impl<T> SliceIndex<[T]> for RangeFrom<usize>
The methods index and index_mut panic if the start of the range is out of bounds.
Source§fn get(self, slice: &[T]) -> Option<&[T]>
fn get(self, slice: &[T]) -> Option<&[T]>
slice_index_methods)Source§fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]>
fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]>
slice_index_methods)Source§unsafe fn get_unchecked(self, slice: *const [T]) -> *const [T]
unsafe fn get_unchecked(self, slice: *const [T]) -> *const [T]
slice_index_methods)Source§unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T]
unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T]
slice_index_methods)1.20.0 (const: unstable) · Source§impl SliceIndex<str> for RangeFrom<usize>
Implements substring slicing with syntax &self[begin ..] or &mut self[begin ..].
impl SliceIndex<str> for RangeFrom<usize>
Implements substring slicing with syntax &self[begin ..] or &mut self[begin ..].
Returns a slice of the given string from the byte range [begin, len).
Equivalent to &self[begin .. len] or &mut self[begin .. len].
This operation is O(1).
Prior to 1.20.0, these indexing operations were still supported by
direct implementation of Index and IndexMut.
§Panics
Panics if begin does not point to the starting byte offset of
a character (as defined by is_char_boundary), or if begin > len.
Source§fn get(self, slice: &str) -> Option<&Self::Output>
fn get(self, slice: &str) -> Option<&Self::Output>
slice_index_methods)Source§fn get_mut(self, slice: &mut str) -> Option<&mut Self::Output>
fn get_mut(self, slice: &mut str) -> Option<&mut Self::Output>
slice_index_methods)Source§unsafe fn get_unchecked(self, slice: *const str) -> *const Self::Output
unsafe fn get_unchecked(self, slice: *const str) -> *const Self::Output
slice_index_methods)Source§unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output
unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output
slice_index_methods)