pub struct State<T: Clone> { /* private fields */ }Expand description
The atomic state
Implementations§
Source§impl<T: Clone> State<T>
impl<T: Clone> State<T>
Sourcepub fn lock(&self) -> StateGuard<'_, T>
pub fn lock(&self) -> StateGuard<'_, T>
Returns a locked state guard
Sourcepub fn get_cloned(&self) -> T
pub fn get_cloned(&self) -> T
Returns a clone of state value
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for State<T>
impl<T> RefUnwindSafe for State<T>where
T: RefUnwindSafe,
impl<T> Send for State<T>
impl<T> Sync for State<T>
impl<T> Unpin for State<T>
impl<T> UnwindSafe for State<T>where
T: RefUnwindSafe,
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