Struct RangeFull

struct RangeFull

An unbounded range (..).

RangeFull is primarily used as a slicing index, its shorthand is ... It cannot serve as an Iterator because it doesn't have a starting point.

Examples

The .. syntax is a RangeFull:

assert_eq!(.., std::ops::RangeFull);

It does not have an IntoIterator implementation, so you can't use it in a for loop directly. This won't compile:

for i in .. {
    // ...
}

Used as a slicing index, RangeFull produces the full array as a slice.

let arr = [0, 1, 2, 3, 4];
assert_eq!(arr[ ..  ], [0, 1, 2, 3, 4]); // This is the `RangeFull`
assert_eq!(arr[ .. 3], [0, 1, 2      ]);
assert_eq!(arr[ ..=3], [0, 1, 2, 3   ]);
assert_eq!(arr[1..  ], [   1, 2, 3, 4]);
assert_eq!(arr[1.. 3], [   1, 2      ]);
assert_eq!(arr[1..=3], [   1, 2, 3   ]);

Implementations

impl Clone for RangeFull

fn clone(self: &Self) -> RangeFull

impl Copy for RangeFull

impl Debug for RangeFull

fn fmt(self: &Self, fmt: &mut Formatter<'_>) -> Result

impl Default for RangeFull

fn default() -> RangeFull

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> i8

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> u128

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> u16

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> i128

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> i16

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> usize

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> u32

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> isize

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> i32

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> bool

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> u64

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> u8

impl Distribution for RangeFull

fn sample<impl RandomSource + ?Sized: RandomSource + ?Sized>(self: &Self, source: &mut impl RandomSource + ?Sized) -> i64

impl Eq for RangeFull

impl Freeze for RangeFull

impl Hash for RangeFull

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl PartialEq for RangeFull

fn eq(self: &Self, other: &RangeFull) -> bool

impl RefUnwindSafe for RangeFull

impl Send for RangeFull

impl SliceIndex for RangeFull

fn get(self: Self, slice: &ByteStr) -> Option<&<Self as >::Output>
fn get_mut(self: Self, slice: &mut ByteStr) -> Option<&mut <Self as >::Output>
unsafe fn get_unchecked(self: Self, slice: *const ByteStr) -> *const <Self as >::Output
unsafe fn get_unchecked_mut(self: Self, slice: *mut ByteStr) -> *mut <Self as >::Output
fn index(self: Self, slice: &ByteStr) -> &<Self as >::Output
fn index_mut(self: Self, slice: &mut ByteStr) -> &mut <Self as >::Output

impl SliceIndex for RangeFull

fn get(self: Self, slice: &str) -> Option<&<Self as >::Output>
fn get_mut(self: Self, slice: &mut str) -> Option<&mut <Self as >::Output>
unsafe fn get_unchecked(self: Self, slice: *const str) -> *const <Self as >::Output
unsafe fn get_unchecked_mut(self: Self, slice: *mut str) -> *mut <Self as >::Output
fn index(self: Self, slice: &str) -> &<Self as >::Output
fn index_mut(self: Self, slice: &mut str) -> &mut <Self as >::Output

impl StructuralPartialEq for RangeFull

impl Sync for RangeFull

impl Unpin for RangeFull

impl UnsafeUnpin for RangeFull

impl UnwindSafe for RangeFull

impl<T> Any for RangeFull

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for RangeFull

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for RangeFull

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for RangeFull

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for RangeFull

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoBounds for RangeFull

fn into_bounds(self: Self) -> (Bound<T>, Bound<T>)

impl<T> SliceIndex for RangeFull

fn get(self: Self, slice: &[T]) -> Option<&[T]>
fn get_mut(self: Self, slice: &mut [T]) -> Option<&mut [T]>
unsafe fn get_unchecked(self: Self, slice: *const [T]) -> *const [T]
unsafe fn get_unchecked_mut(self: Self, slice: *mut [T]) -> *mut [T]
fn index(self: Self, slice: &[T]) -> &[T]
fn index_mut(self: Self, slice: &mut [T]) -> &mut [T]

impl<T, U> Into for RangeFull

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for RangeFull

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for RangeFull

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: ?Sized> RangeBounds for RangeFull

fn start_bound(self: &Self) -> Bound<&T>
fn end_bound(self: &Self) -> Bound<&T>