Operations on tuples

Trait CopyableTuple

Method extensions to pairs where both types satisfy the Clone bound

Method first

fn first(&self) -> T

Return the first element of self

Method second

fn second(&self) -> U

Return the second element of self

Method swap

fn swap(&self) -> (U, T)

Return the results of swapping the two elements of self

Trait ImmutableTuple

Method extensions for pairs where the types don't necessarily satisfy the Clone bound

Method first_ref

fn first_ref<'a>(&'a self) -> &'a T

Return a reference to the first element of self

Method second_ref

fn second_ref<'a>(&'a self) -> &'a U

Return a reference to the second element of self

Implementation of CopyableTuple<T, U> for (T, U) where <T: Clone, U: Clone>

Method first

fn first(&self) -> T

Return the first element of self

Method second

fn second(&self) -> U

Return the second element of self

Method swap

fn swap(&self) -> (U, T)

Return the results of swapping the two elements of self

Implementation of ImmutableTuple<T, U> for (T, U) where <T, U>

Method first_ref

fn first_ref<'a>(&'a self) -> &'a T

Method second_ref

fn second_ref<'a>(&'a self) -> &'a U