Trait tuple::TupleElements [] [src]

pub unsafe trait TupleElements: Sized {
    type Element;

    const N: usize;

    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>
; fn elements(&self) -> Elements<&Self> { ... }
fn elements_mut(&mut self) -> Elements<&mut Self> { ... }
fn into_elements(self) -> IntoElements<Self> { ... } }

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 implementation.

Associated Types

Associated Constants

Required Methods

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.

Provided Methods

returns an Iterator over references to the elements of the tuple

returns an Iterator over mutable references to elements of the tuple

Implementors