pub struct RwCell<T> { /* private fields */ }Expand description
A lightweight reference-counted cell. Aborts the program when borrows conflict.
Implementations§
Source§impl<T> RwCell<T>
impl<T> RwCell<T>
Sourcepub fn borrow(&self) -> RwCellGuard<'_, Const, T>
pub fn borrow(&self) -> RwCellGuard<'_, Const, T>
Immutably borrows the value of this cell.
Sourcepub fn borrow_mut(&self) -> RwCellGuard<'_, Mut, T>
pub fn borrow_mut(&self) -> RwCellGuard<'_, Mut, T>
Mutably borrows the value of this cell.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for RwCell<T>
impl<T> !RefUnwindSafe for RwCell<T>
impl<T> Send for RwCell<T>where
T: Send,
impl<T> !Sync for RwCell<T>
impl<T> Unpin for RwCell<T>where
T: Unpin,
impl<T> UnwindSafe for RwCell<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