pub enum SharedWriteGuard<'a, T> {
TokioSync(RwLockWriteGuard<'a, T>),
Single(RefMut<'a, T>),
}
Expand description
A writable guard for accessing and modifying data in a SharedContainer
.
This type abstracts over the differences between different write guards:
std::sync::RwLockWriteGuard
(used in standard multi-threaded environments)tokio::sync::RwLockWriteGuard
(used for async/await support)std::cell::RefMut
(used in single-threaded environments like WebAssembly)
It implements both Deref
and DerefMut
to allow transparent access to the underlying data.
Variants§
TokioSync(RwLockWriteGuard<'a, T>)
Single(RefMut<'a, T>)
Trait Implementations§
Auto Trait Implementations§
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