pub struct LoopCellAccess<'cell, T> { /* private fields */ }
Expand description
Accessor for a LoopCell
, that will automatically write back any modifications to T
when dropped (or manually committed), unless you deliberately disarm it with
LoopCellAccess::consume
to make it so the LoopCell
is “used up”.
The Send
-equivalent form is LoopSyncCellAccess
Implementations§
Source§impl<'cell, T> LoopCellAccess<'cell, T>
impl<'cell, T> LoopCellAccess<'cell, T>
Sourcepub fn commit(self)
pub fn commit(self)
Consume the accessor and commit the changes made to the LoopCell
’s value, making the
value available once again to anyone trying to get it via LoopCell::access
. Equivalent
to mem::drop
Sourcepub fn into_mapped_access(self) -> LoopCellMappedAccess<'cell, T, ()>
pub fn into_mapped_access(self) -> LoopCellMappedAccess<'cell, T, ()>
Get a version of this capable of being mapped.
Sourcepub fn map_loopcell_access<O>(
self,
f: impl FnOnce(&mut T) -> O,
) -> LoopCellMappedAccess<'cell, T, O>
pub fn map_loopcell_access<O>( self, f: impl FnOnce(&mut T) -> O, ) -> LoopCellMappedAccess<'cell, T, O>
Directly map this bare LoopCellAccess
into one that is “mapped” to another value.
Sourcepub fn as_loopcell_value(&self) -> &T
pub fn as_loopcell_value(&self) -> &T
Get the value of the loopcell from the access
Sourcepub fn as_loopcell_value_mut(&mut self) -> &mut T
pub fn as_loopcell_value_mut(&mut self) -> &mut T
Get the value of the loopcell from the access, mutably.
Trait Implementations§
Source§impl<'cell, T> AsMut<T> for LoopCellAccess<'cell, T>
impl<'cell, T> AsMut<T> for LoopCellAccess<'cell, T>
Source§impl<'cell, T> AsRef<T> for LoopCellAccess<'cell, T>
impl<'cell, T> AsRef<T> for LoopCellAccess<'cell, T>
Source§impl<'cell, T: Debug> Debug for LoopCellAccess<'cell, T>
impl<'cell, T: Debug> Debug for LoopCellAccess<'cell, T>
Source§impl<'cell, T> Deref for LoopCellAccess<'cell, T>
impl<'cell, T> Deref for LoopCellAccess<'cell, T>
Source§impl<'cell, T> DerefMut for LoopCellAccess<'cell, T>
impl<'cell, T> DerefMut for LoopCellAccess<'cell, T>
Source§impl<'cell, T> Drop for LoopCellAccess<'cell, T>
impl<'cell, T> Drop for LoopCellAccess<'cell, T>
Source§impl<'cell, T, V: Default> From<LoopCellAccess<'cell, T>> for LoopCellMappedAccess<'cell, T, V>
impl<'cell, T, V: Default> From<LoopCellAccess<'cell, T>> for LoopCellMappedAccess<'cell, T, V>
Source§fn from(bare_access: LoopCellAccess<'cell, T>) -> Self
fn from(bare_access: LoopCellAccess<'cell, T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'cell, T> Freeze for LoopCellAccess<'cell, T>where
T: Freeze,
impl<'cell, T> !RefUnwindSafe for LoopCellAccess<'cell, T>
impl<'cell, T> !Send for LoopCellAccess<'cell, T>
impl<'cell, T> !Sync for LoopCellAccess<'cell, T>
impl<'cell, T> Unpin for LoopCellAccess<'cell, T>where
T: Unpin,
impl<'cell, T> !UnwindSafe for LoopCellAccess<'cell, T>
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