Trait HomogenousVariadic

Source
pub trait HomogenousVariadic<T>: Variadic + Sealed<T> {
    type IntoIter: Iterator<Item = T>;

    // Required methods
    fn get(&self, i: usize) -> Option<&T>;
    fn get_mut(&mut self, i: usize) -> Option<&mut T>;
    fn into_iter(self) -> Self::IntoIter;
}
Expand description

A variadic where all elements are the same type, T.

This is a sealed trait.

Required Associated Types§

Source

type IntoIter: Iterator<Item = T>

Iterator type returned by into_iter.

Required Methods§

Source

fn get(&self, i: usize) -> Option<&T>

Returns a reference to an element.

Source

fn get_mut(&mut self, i: usize) -> Option<&mut T>

Returns an exclusive reference to an element.

Source

fn into_iter(self) -> Self::IntoIter

Turns this HomogenousVariadic<T> into an iterator of items T.

Implementations on Foreign Types§

Source§

impl<T> HomogenousVariadic<T> for ()

Source§

type IntoIter = Empty<T>

Source§

fn get(&self, _i: usize) -> Option<&T>

Source§

fn get_mut(&mut self, _i: usize) -> Option<&mut T>

Source§

fn into_iter(self) -> Self::IntoIter

Source§

impl<T, Rest> HomogenousVariadic<T> for (T, Rest)
where Rest: HomogenousVariadic<T>,

Source§

type IntoIter = Chain<Once<T>, <Rest as HomogenousVariadic<T>>::IntoIter>

Source§

fn get(&self, i: usize) -> Option<&T>

Source§

fn get_mut(&mut self, i: usize) -> Option<&mut T>

Source§

fn into_iter(self) -> Self::IntoIter

Implementors§