[−][src]Macro procspawn::spawn
Utility macro to spawn functions.
Since a very common pattern is to pass multiple values to a spawned function by using tuples it can be cumbersome to repeat the arguments. This macro makes it possible to not repeat oneself. The first argument to the macro is a tuple of the arguments to pass, the second argument is the closure that should be invoked.
For each argument the following expressions are possible:
ident: uses the local variableidentunchanged.ident => other: serializesidentand deserializes intoother*ident: alias for*ident => ident.mut ident: alias forident => mut ident.
Example:
let a = 42u32; let b = 23u32; let handle = procspawn::spawn!((a, mut b) || { b += 1; a + b });