pin-arc-0.2.0 has been yanked.
This crate provides reference counting pointers similar to Rc and Arc, but without heap allocation.
You are responsible for creating a Pin{Arc|Rc}Storage, which you can obtain Pin{Arc|Rc} pointers from.
The storage needs to be pinned, for example using pin.
# use pin;
# use ;
let storage = pin!;
let arc = storage.as_ref.create_handle;
println!;
If the storage is dropped before all references to it are released, the program is aborted (even if you have set panics to unwind):
# use std::pin::pin;
# use pin_arc::{PinArc,PinArcStorage};
fn escaping_handle() -> PinArc<u32> {
let storage = pin!(PinArcStorage::new(4));
storage.as_ref().create_handle()
}
escaping_handle();