Trait tuple::TupleElements [] [src]

pub unsafe trait TupleElements {
    type Element;

    const N: usize;

    fn elements(&self) -> Elements<&Self>;
    fn elements_mut(&mut self) -> Elements<&mut Self>;
    fn get(&self, n: usize) -> Option<&Self::Element>;
    fn get_mut(&mut self, n: usize) -> Option<&mut Self::Element>;
}

This trais is marked as unsafe, due to the requirement of the get_mut method, which is required work as an injective map of index -> element

Associated Types

Associated Constants

N: usize

Required Methods

returns an Iterator over references to the elements of the tuple

returns an Iterator over mutable references to elements of the tuple

attempt to access the n-th element

attempt to access the n-th element mutablbly. This function shall not return the same data for two different indices.

Implementors