Operations on tuples

Trait CopyableTuple

Method extensions to pairs where both types satisfy the Copy 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 ExtendedTupleOps

Method zip

fn zip(&self) -> ~[(A, B)]

Method map

fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C]

Trait ImmutableTuple

Method extensions for pairs where the types don't necessarily satisfy the Copy 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: Copy, U: Copy>

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

Implementation of ExtendedTupleOps<A, B> for (&'self [A], &'self [B]) where <'self, A: Copy, B: Copy>

Method zip

fn zip(&self) -> ~[(A, B)]

Method map

fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C]

Implementation of ExtendedTupleOps<A, B> for (~[A], ~[B]) where <A: Copy, B: Copy>

Method zip

fn zip(&self) -> ~[(A, B)]

Method map

fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C]