macro_rules! uninit_on_stack {
    ($($ty:ty)?) => { ... };
}
Expand description

Constructs an uninitialized smart pointer on the current calling stack.

This macro is the shorthand for on_stack!(MaybeUninit::uninit()); users can specify the desired type in the arguments of this macro.

The user can either write this pointer with a value to obtain the initialized result, or use an in-place initializer.

Examples

use owned_pin::{uninit_on_stack, OnStack};

let uninit = uninit_on_stack!(String);
let pointer = OnStack::write(uninit, "Hello!".into());
assert_eq!(*pointer, "Hello!");