pub struct Shared<S> { /* private fields */ }Expand description
A cloneable, shareable handle to a store.
Reader/Writer take &mut self, so sharing a store between owners
requires a lock. Shared is that lock, packaged: it implements the
store traits over Arc<Mutex<S>> so callers don’t hand-roll the
wrapper. Lock poisoning is recovered from (the store may be mid-update,
but path-level operations are individually atomic).
Implementations§
Sourcepub fn lock(&self) -> MutexGuard<'_, S>
pub fn lock(&self) -> MutexGuard<'_, S>
Access the underlying store directly.
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