Trait IterableByValueFrom

Source
pub trait IterableByValueFrom: IterableByValue {
    type IterFrom<'a>: Iterator<Item = <Self as IterableByValue>::Item>
       where Self: 'a;

    // Required method
    fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>;
}
Expand description

A trait for obtaining a value-based iterator starting from a given position.

This is an version of IterableByValue::iter_value that is useful for types in which obtaining a global iterator and skipping is expensive. Note that we cannot provide a skip-based default implementation because the returned type is not necessarily the same type as that returned by IterableByValue::iter_value, but you are free to implement iter_value_from that way.

Required Associated Types§

Source

type IterFrom<'a>: Iterator<Item = <Self as IterableByValue>::Item> where Self: 'a

Required Methods§

Source

fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>

Returns an iterator on values starting at the given position.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Clone> IterableByValueFrom for [T]

Source§

type IterFrom<'a> = Cloned<Skip<Iter<'a, T>>> where T: 'a

Source§

fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>

Source§

impl<T: Clone> IterableByValueFrom for Box<[T]>

Source§

type IterFrom<'a> = Cloned<Skip<Iter<'a, T>>> where T: 'a

Source§

fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>

Source§

impl<T: Clone> IterableByValueFrom for Vec<T>

Source§

type IterFrom<'a> = Cloned<Skip<Iter<'a, T>>> where T: 'a

Source§

fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>

Source§

impl<T: Clone, const N: usize> IterableByValueFrom for [T; N]

Source§

type IterFrom<'a> = Cloned<Skip<Iter<'a, T>>> where T: 'a

Source§

fn iter_value_from(&self, from: usize) -> Self::IterFrom<'_>

Implementors§