Trait variadics::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§

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

source§

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

source§

type IntoIter = Empty<T>

source§

fn into_iter(self) -> Self::IntoIter

source§

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

source§

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

source§

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

source§

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

source§

fn into_iter(self) -> Self::IntoIter

Implementors§