pub struct RefCell<T> { /* private fields */ }
Expand description
RefCell is a non thread-safe container for T
Implementations§
Source§impl<T> RefCell<T>
impl<T> RefCell<T>
Sourcepub fn borrow(&self) -> Option<Ref<'_, T>>
pub fn borrow(&self) -> Option<Ref<'_, T>>
Return an immutable shared reference to T
, IFF there exists no other
exclusive references to T
already given out
Sourcepub fn borrow_mut(&self) -> Option<RefMut<'_, T>>
pub fn borrow_mut(&self) -> Option<RefMut<'_, T>>
Return a mutable shared reference to T
, IFF there exists no other
exclusive references to T
already given out
Auto Trait Implementations§
impl<T> !Freeze for RefCell<T>
impl<T> !RefUnwindSafe for RefCell<T>
impl<T> Send for RefCell<T>where
T: Send,
impl<T> !Sync for RefCell<T>
impl<T> Unpin for RefCell<T>where
T: Unpin,
impl<T> UnwindSafe for RefCell<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