Operations on tuples
CopyableTuple
- Method extensions to pairs where both types satisfy the Clone
boundImmutableTuple
- Method extensions for pairs where the types don't necessarily satisfy the Clone
boundof CopyableTuple<T, U> for (T, U) where <T: Clone, U: Clone>
of ImmutableTuple<T, U> for (T, U) where <T, U>
tuple::inner
CopyableTuple
Method extensions to pairs where both types satisfy the Clone
bound
first
fn first(&self) -> T
Return the first element of self
second
fn second(&self) -> U
Return the second element of self
swap
fn swap(&self) -> (U, T)
Return the results of swapping the two elements of self
ImmutableTuple
Method extensions for pairs where the types don't necessarily satisfy the Clone
bound
first_ref
fn first_ref<'a>(&'a self) -> &'a T
Return a reference to the first element of self
second_ref
fn second_ref<'a>(&'a self) -> &'a U
Return a reference to the second element of self
CopyableTuple<T, U>
for (T, U)
where <T: Clone, U: Clone>
first
fn first(&self) -> T
Return the first element of self
second
fn second(&self) -> U
Return the second element of self
swap
fn swap(&self) -> (U, T)
Return the results of swapping the two elements of self
ImmutableTuple<T, U>
for (T, U)
where <T, U>
first_ref
fn first_ref<'a>(&'a self) -> &'a T
second_ref
fn second_ref<'a>(&'a self) -> &'a U