pub trait Container<T>: Sealed<T> {
    type Iter: Iterator<Item = T>;

    // Required method
    fn get_iter(&self) -> Self::Iter;
}
Expand description

A utility trait to abstract over container-like things.

This trait is sealed and an implementation detail - its internals should not be relied on by users.

Required Associated Types§

source

type Iter: Iterator<Item = T>

An iterator over the items within this container, by value.

Required Methods§

source

fn get_iter(&self) -> Self::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).

Implementations on Foreign Types§

source§

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

§

type Iter = IntoIter<T, N>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<'a> Container<char> for &'a str

§

type Iter = Chars<'a>

source§

fn get_iter(&self) -> Self::Iter

source§

impl Container<char> for String

§

type Iter = IntoIter<char, Global>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<T: Clone> Container<T> for BinaryHeap<T>

§

type Iter = IntoIter<T>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<T: Clone> Container<T> for BTreeSet<T>

§

type Iter = IntoIter<T, Global>

source§

fn get_iter(&self) -> Self::Iter

source§

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

§

type Iter = IntoIter<T, Global>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<'a, T: Clone> Container<T> for &'a [T]

§

type Iter = Cloned<Iter<'a, T>>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<T: Clone> Container<T> for HashSet<T>

§

type Iter = IntoIter<T>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<T: Clone> Container<T> for VecDeque<T>

§

type Iter = IntoIter<T, Global>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<'a, T: Clone, const N: usize> Container<T> for &'a [T; N]

§

type Iter = Cloned<Iter<'a, T>>

source§

fn get_iter(&self) -> Self::Iter

source§

impl<T: Clone> Container<T> for LinkedList<T>

§

type Iter = IntoIter<T>

source§

fn get_iter(&self) -> Self::Iter

Implementors§

source§

impl<T: Clone> Container<T> for T

§

type Iter = Once<T>