#How does the tokio::join! macro work?

3 messages · Page 1 of 1 (latest)

tepid bronze
#

i thought rust doesn't have variadic generics. so how does the join macro even work?

let a: (i32, f64, i32) = tokio::join!(async { 1 }, async { 2.0 }, async { 3 } );

it works with any number of arguments

let a: (T0, T1, T2, .....Tn) = tokio::join!( async { T1::new() }, ...., async { Tn::new() } );
burnt holly
#

simple: macros aren't functions. it's the same for the println macro

#

macros can have a variable number of arguments