macro_rules! sendwrap_fn {
(move |$($param:ident : $ty:ty),*| $($content:tt)*) => { ... };
(once move |$($param:ident : $ty:ty),*| $($content:tt)*) => { ... };
(move |$($param:ident),*| $($content:tt)*) => { ... };
(once move |$($param:ident),*| $($content:tt)*) => { ... };
(once move || $($content:tt)*) => { ... };
(move || $($content:tt)*) => { ... };
}Expand description
Macro to wrap closures with send_wrapper::SendWrapper.
ยงUsage
let wrapped = sendwrap_fn!(move |a: i32, b: i32| { /* do stuff */ });For closures that implement only FnOnce:
let wrapped = sendwrap_fn!(once move || { /* do stuff */ });