pub struct StateRefCell<T> { /* private fields */ }
Expand description
A mutable memory location with dynamically checked borrow rules
This is similar to RefCell
but instead of returned wrapped
reference, it returns the value directly.
This means that once the value is borrowed to read it will never get available again.
Implementations§
Source§impl<T> StateRefCell<T>
impl<T> StateRefCell<T>
pub const fn new(val: T) -> Self
pub fn into_inner(self) -> T
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for StateRefCell<T>
impl<T> !RefUnwindSafe for StateRefCell<T>
impl<T> Send for StateRefCell<T>where
T: Send,
impl<T> !Sync for StateRefCell<T>
impl<T> Unpin for StateRefCell<T>where
T: Unpin,
impl<T> UnwindSafe for StateRefCell<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