Trait tuple_list::AsTupleOfRefs[][src]

pub trait AsTupleOfRefs<'a>: Tuple {
    type TupleOfRefs: Tuple + 'a;
    type TupleOfMutRefs: Tuple + 'a;
    fn as_tuple_of_refs(&'a self) -> Self::TupleOfRefs;
fn as_tuple_of_mut_refs(&'a mut self) -> Self::TupleOfMutRefs; }
Expand description

Trait providing conversion from references to tuples into tuples of references.

Generic trait implemented for all tuples (up to 12 elements).

Example

use tuple_list::AsTupleOfRefs;
 
fn by_val(tuple: (i32, i32)) {}
fn by_ref(tuple: (&i32, &i32)) {}
fn by_mut(tuple: (&mut i32, &mut i32)) {}
 
let mut tuple = (1, 2);
by_val(tuple);
by_ref(tuple.as_tuple_of_refs());
by_mut(tuple.as_tuple_of_mut_refs());
Run

Associated Types

Required methods

Converts reference to tuple into tuple of references.

Converts mutable reference to tuple into tuple of mutable references.

Implementations on Foreign Types

Implementors