Struct RangeInclusiveIter

pub struct RangeInclusiveIter<A>(pub(in ::range::iter) RangeInclusive<A>);

By-value RangeInclusive iterator.

Fields

0: RangeInclusive<A>

Implementations

impl<A: Step> RangeInclusiveIter<A>

fn remainder(self) -> Option<RangeInclusive<A>>

Returns the remainder of the range being iterated over.

If the iterator is exhausted or empty, returns None.

Examples

#![feature(new_range_remainder)]

let range = core::range::RangeInclusive::from(3..=11);
let mut iter = range.into_iter();
assert_eq!(iter.clone().remainder().unwrap(), range);
iter.next();
assert_eq!(iter.clone().remainder().unwrap(), core::range::RangeInclusive::from(4..=11));
iter.by_ref().for_each(drop);
assert!(iter.remainder().is_none());

Trait Implementations

impl ExactSizeIterator for RangeInclusiveIter<i8>

impl ExactSizeIterator for RangeInclusiveIter<u8>

impl<A: Clone> Clone for RangeInclusiveIter<A>

fn clone(&self) -> RangeInclusiveIter<A>

impl<A: Debug> Debug for RangeInclusiveIter<A>

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

impl<A: Step> DoubleEndedIterator for RangeInclusiveIter<A>

fn next_back(&mut self) -> Option<A>
fn nth_back(&mut self, n: usize) -> Option<A>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

impl<A: Step> FusedIterator for RangeInclusiveIter<A>

impl<A: Step> Iterator for RangeInclusiveIter<A>

type Item = A;
fn next(&mut self) -> Option<A>
fn size_hint(&self) -> (usize, Option<usize>)
fn count(self) -> usize
fn nth(&mut self, n: usize) -> Option<A>
fn last(self) -> Option<A>
fn min(self) -> Option<A>
where
    A: Ord,
fn max(self) -> Option<A>
where
    A: Ord,
fn is_sorted(self) -> bool
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

impl<A: TrustedStep> TrustedLen for RangeInclusiveIter<A>

Auto Trait Implementations

impl<A> Freeze for RangeInclusiveIter<A> where RangeInclusive<A>: Freeze,

impl<A> RefUnwindSafe for RangeInclusiveIter<A> where RangeInclusive<A>: RefUnwindSafe,

impl<A> Send for RangeInclusiveIter<A> where RangeInclusive<A>: Send,

impl<A> Sync for RangeInclusiveIter<A> where RangeInclusive<A>: Sync,

impl<A> Unpin for RangeInclusiveIter<A> where RangeInclusive<A>: Unpin,

impl<A> UnsafeUnpin for RangeInclusiveIter<A> where RangeInclusive<A>: UnsafeUnpin,

impl<A> UnwindSafe for RangeInclusiveIter<A> where RangeInclusive<A>: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for RangeInclusiveIter<A> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for RangeInclusiveIter<A> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for RangeInclusiveIter<A> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for RangeInclusiveIter<A> where T: ?Sized,

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

impl<T> CloneToUninit for RangeInclusiveIter<A> where T: Clone,

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

impl<T> From<T> for RangeInclusiveIter<A>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for RangeInclusiveIter<A> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for RangeInclusiveIter<A>

impl<T, U> Into<U> for RangeInclusiveIter<A> where U: From<T>,

fn into(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<U> for RangeInclusiveIter<A> where U: Into<T>,

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

impl<T, U> TryInto<U> for RangeInclusiveIter<A> where U: TryFrom<T>,

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