macro_rules! try_opin_init {
    (let $value:tt $(: $ty:ty)? = $($init:tt)*) => { ... };
}
Expand description

Attempts to initialize and pin an owned value directly on the stack using an initializer of PinInit.

Examples

use owned_pin::{try_opin_init, OPin};
use pinned_init::pin_data;

#[pin_data]
struct A {
    x: u32
}

try_opin_init!(let a = A { x: 64 });
assert_eq!(a.unwrap().x, 64);