#unsafe-cell #refcell #hybrid #build #panic #exclusive

fairly_unsafe_cell

A hybrid between an UnsafeCell and a RefCell

1 unstable release

0.1.0 Apr 9, 2025

#5 in #unsafe-cell

Download history 18/week @ 2025-11-04 31/week @ 2025-11-11 35/week @ 2025-11-18 25/week @ 2025-11-25 49/week @ 2025-12-02 14/week @ 2025-12-09 44/week @ 2025-12-16 32/week @ 2025-12-23 20/week @ 2025-12-30 9/week @ 2026-01-06 7/week @ 2026-01-13 21/week @ 2026-01-20 32/week @ 2026-01-27 26/week @ 2026-02-03 11/week @ 2026-02-10 21/week @ 2026-02-17

94 downloads per month
Used in 11 crates (3 directly)

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