macro_rules! future_fn {
($($var:ident),*, { $($closure_body:tt)* }) => { ... };
($($var:ident),*, |$( $closure_param:ident $(: $closure_param_ty:ty)? ),*| { $($closure_body:tt)* }) => { ... };
}
Expand description
Generates an asynchronous closure that clones specified external variables and executes the given closure body asynchronously.
This macro supports two forms:
- An async closure with no parameters.
- An async closure with specified parameters.