Trait tuple::TupleElements [] [src]

pub unsafe trait TupleElements: Sized {
    type Element;

    const N: usize;

    fn elements(&self) -> Elements<&Self>;
    fn elements_mut(&mut self) -> Elements<&mut Self>;
    fn into_elements(self) -> IntoElements<Self>;
    fn get(&self, n: usize) -> Option<&Self::Element>;
    fn get_mut(&mut self, n: usize) -> Option<&mut Self::Element>;
    fn from_iter<I>(iter: I) -> Option<Self>
    where
        I: Iterator<Item = 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 A tuple must not have a Drop implentation.

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