Macro meta_tuple

Source
macro_rules! meta_tuple {
    () => { ... };
    (@[$prev: expr]) => { ... };
    (@[$prev: expr] #$e: expr $(, $($rest: tt)*)?) => { ... };
    (@[$prev: expr] &mut $e: expr $(, $($rest: tt)*)?) => { ... };
    (@[$prev: expr] &$e: expr $(, $($rest: tt)*)?) => { ... };
    (@[$prev: expr] $e: expr $(, $($rest: tt)*)?) => { ... };
    (#$e: expr $(, $($rest: tt)*)?) => { ... };
    (&mut $e: expr $(, $($rest: tt)*)?) => { ... };
    (&$e: expr $(, $($rest: tt)*)?) => { ... };
    ($e: expr $(, $($rest: tt)*)?) => { ... };
}
Expand description

Create a MetaTuple.

ยงSyntax

To create a tuple like MetaTuple:

meta_tuple!(1, 2.0, "hello", vec![1, 2])

You can use & and &mut, to create non-static MetaTuples, keep in mind these are handled at the syntax level and not the type level.

let a = 1;
let b = true
meta_tuple!(&a, &mut b);

If already given a reference x: &T, using x is not allowed as the type of x is not static, use &*x instead.

let a = &1;
let b = &mut true
meta_tuple!(&*a, &mut *b);

To join types that are already MetaTuples, denote with a #.

let a = meta_tuple!(1, 2.0);
let b = meta_tuple!(true);
let c = meta_tuple!(#a, #b, "hello");