Macro moveit::stackbox [−][src]
macro_rules! stackbox { ($(let $(mut)? $name:ident $(: $ty:ty)? = $expr:expr);*) => { ... }; }
Constructs a StackBox
.
Because StackBox
es need to own data on the stack, but that data cannot
move with the StackBox
, it must be constructed using this macro. For
example:
stackbox!(let x = 5); stackbox! { let y: StackBox<i32> = StackBox::into_inner(x); let mut z = *y as u64; }
This macro is a shortcut for calling slot!
followed by
Slot::put()
.