Macro owned_pin::opin_init

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

Initializes and pins an owned value directly on the stack using an initializer of PinInit.

Examples

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

#[pin_data]
struct A {
    x: u32
}

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