Macro owned_pin::try_apin_init
source · macro_rules! try_apin_init { (let $value:ident $(:$ty:ty)? = $($init:tt)*) => { ... }; }
Expand description
Attempts to initialize and pin an Arsc pointer on the current calling
stack.
Examples
use owned_pin::sync::{try_apin_init, RefCounted, RefCount};
use pinned_init::pin_data;
#[pin_data]
#[derive(RefCounted)]
struct A {
x: u32,
#[count_on]
rc: RefCount,
}
try_apin_init!(let a = A { x: 64, rc: RefCount::new() });
assert_eq!(a.unwrap().x, 64);