| Crates.io | atomic_pincell |
| lib.rs | atomic_pincell |
| version | 0.1.0 |
| created_at | 2025-02-02 20:02:03.922409+00 |
| updated_at | 2025-03-01 13:20:07.329274+00 |
| description | Threadsafe pinnable RefCell |
| homepage | |
| repository | https://github.com/m-mueller678/atomic_refcell |
| max_upload_size | |
| id | 1539827 |
| size | 46,815 |
This is a fork of atomic_refcell that adds the ability to pin cell contents like the non-thread-safe pin-cell.
fn pin_cell() {
let pinned_cell = pin!(AtomicRefCell::<MyPinnedType, true>::default());
takes_pinned(pinned_cell.as_ref().borrow_pin_mut().get_pin_mut());
takes_ref(&pinned_cell.borrow());
}
This crate also intends to be a drop in replacement for atomic_refcell.
fn unpin_cell() {
let unpinned_cell = AtomicRefCell::<MyPinnedType>::default();
mem::take(&mut *unpinned_cell.borrow_mut());
takes_ref(&*unpinned_cell.borrow());
}