pub struct ICoWLock<'lock, ITEM: Sized> { /* private fields */ }Expand description
A write-guard which holds new value to which the new values are written. And previous value too. This type of guard is exclusive, so multiple CoW operations CANNOT be performed in parallel which is good for instance update without racing. The readers are also waiting until the changes are commited.
If dropped, no changes will be made.
Implementations§
Source§impl<'lock, ITEM: Sized> ICoWLock<'lock, ITEM>
impl<'lock, ITEM: Sized> ICoWLock<'lock, ITEM>
Sourcepub fn commit(self)
pub fn commit(self)
Commits the changes made in the current guarded instance guarantees that the future readers will read new value and no other writes will be perfomed at the same time.
§Returns
Returns nothing
Sourcepub fn commit_wiht_into_inner(self) -> Arc<ITEM>
pub fn commit_wiht_into_inner(self) -> Arc<ITEM>
Trait Implementations§
Auto Trait Implementations§
impl<'lock, ITEM> !Freeze for ICoWLock<'lock, ITEM>
impl<'lock, ITEM> !RefUnwindSafe for ICoWLock<'lock, ITEM>
impl<'lock, ITEM> !Send for ICoWLock<'lock, ITEM>
impl<'lock, ITEM> !Sync for ICoWLock<'lock, ITEM>
impl<'lock, ITEM> Unpin for ICoWLock<'lock, ITEM>where
ITEM: Unpin,
impl<'lock, ITEM> UnwindSafe for ICoWLock<'lock, ITEM>where
ITEM: 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