Iter

Trait Iter 

Source
pub trait Iter {
    type Output<'iter>: Iterator
       where Self: 'iter;

    // Required method
    fn iter(&self) -> Self::Output<'_>;
}
Expand description

See Iter::iter for more information.

Required Associated Types§

Source

type Output<'iter>: Iterator where Self: 'iter

Iterator

Required Methods§

Source

fn iter(&self) -> Self::Output<'_>

Returns a new iterator that refers inner elements.

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 Iter for ()

assert_eq!(cl_aux::Iter::iter(&()).next(), None);
Source§

type Output<'iter> = Iter<'iter, ()>

Source§

fn iter(&self) -> Self::Output<'_>

Source§

impl<T> Iter for &[T]

let structure = cl_aux::doc_tests::slice();
assert_eq!(cl_aux::Iter::iter(&structure).next().unwrap(), &1);
Source§

type Output<'iter> = Iter<'iter, T> where Self: 'iter

Source§

fn iter(&self) -> Self::Output<'_>

Source§

impl<T> Iter for Option<T>

assert_eq!(cl_aux::Iter::iter(&Some(0)).next().unwrap(), &0);
Source§

type Output<'iter> = Iter<'iter, T> where T: 'iter

Source§

fn iter(&self) -> Self::Output<'_>

Source§

impl<T> Iter for &T
where T: Iter,

Source§

type Output<'iter> = <T as Iter>::Output<'iter> where Self: 'iter

Source§

fn iter(&self) -> Self::Output<'_>

Source§

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

let mut structure = cl_aux::doc_tests::array();
assert_eq!(cl_aux::Iter::iter(&structure).next().unwrap(), &1);
Source§

type Output<'iter> = Iter<'iter, T> where T: 'iter

Source§

fn iter(&self) -> Self::Output<'_>

Implementors§

Source§

impl<T> Iter for SingleItemStorage<T>

let structure = cl_aux::doc_tests::single_item_storage();
assert_eq!(cl_aux::Iter::iter(&structure).next().unwrap(), &1);
Source§

type Output<'iter> = Iter<'iter, T> where T: 'iter