#refcell #unsafe-cell #fairly

fairly_unsafe_cell

A hybrid between an UnsafeCell and a RefCell

1 unstable release

new 0.1.0 Apr 9, 2025

#9 in #unsafe-cell


Used in 4 crates (via wb_async_utils)

MIT/Apache

515KB
322 lines

A hybrid between an UnsafeCell and a RefCell: comes with a RefCell-like but unsafe API that panics in test builds (#[cfg(test)]) when mutable access is not exclusive, but has no overhead (and allows for UB) in non-test builds.


Fairly Unsafe Cell

A hybrid between an UnsafeCell and a RefCell: comes with an unsafe but RefCell-like API that panics in test builds (#[cfg(test)]) when mutable access is not exclusive, but has no overhead (and allows for UB) in non-test builds.

No runtime deps