pub struct ArfCell<T> {
state: AtomicUsize,
item: UnsafeCell<T>,
}
Expand description
Atomic ReFCell - ArfCell
Like a refcell (or RwLock), but atomic, has a const constructor, and doesn’t panic
Fields§
§state: AtomicUsize
§item: UnsafeCell<T>
Implementations§
source§impl<T> ArfCell<T>
impl<T> ArfCell<T>
const MUTLOCK: usize = 9_223_372_036_854_775_808usize
pub const fn new(item: T) -> Self
pub fn borrow_mut(&self) -> Result<MutArfGuard<'_, T>, BorrowError>
pub fn borrow(&self) -> Result<ArfGuard<'_, T>, BorrowError>
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ArfCell<T>
impl<T> Send for ArfCell<T>where T: Send,
impl<T> Unpin for ArfCell<T>where T: Unpin,
impl<T> UnwindSafe for ArfCell<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more