pub struct MutexStorage;Expand description
SharedStorage implementation backed by Mutex.
Trait Implementations§
Source§type Storage<T> = Mutex<SharedValue<T>>
type Storage<T> = Mutex<SharedValue<T>>
Concrete cell or lock type containing
SharedValue<T>.Source§type ReadGuard<'a, T> = MutexGuard<'a, SharedValue<T>>
where
T: 'a
type ReadGuard<'a, T> = MutexGuard<'a, SharedValue<T>> where T: 'a
Guard returned by read access.
Source§type WriteGuard<'a, T> = MutexGuard<'a, SharedValue<T>>
where
T: 'a
type WriteGuard<'a, T> = MutexGuard<'a, SharedValue<T>> where T: 'a
Guard returned by write access.
Source§type ReadError<'a, T> = TryLockError<MutexGuard<'a, SharedValue<T>>>
where
T: 'a
type ReadError<'a, T> = TryLockError<MutexGuard<'a, SharedValue<T>>> where T: 'a
Error returned by read access.
Source§type WriteError<'a, T> = TryLockError<MutexGuard<'a, SharedValue<T>>>
where
T: 'a
type WriteError<'a, T> = TryLockError<MutexGuard<'a, SharedValue<T>>> where T: 'a
Error returned by write access.
Source§fn new<T>(value: SharedValue<T>) -> Self::Storage<T>
fn new<T>(value: SharedValue<T>) -> Self::Storage<T>
Creates backend storage containing the authoritative state and runtime data.
Source§fn read<T>(
storage: &Self::Storage<T>,
) -> Result<Self::ReadGuard<'_, T>, Self::ReadError<'_, T>>
fn read<T>( storage: &Self::Storage<T>, ) -> Result<Self::ReadGuard<'_, T>, Self::ReadError<'_, T>>
Attempts read access to the backend storage.
Source§fn write<T>(
storage: &Self::Storage<T>,
) -> Result<Self::WriteGuard<'_, T>, Self::WriteError<'_, T>>
fn write<T>( storage: &Self::Storage<T>, ) -> Result<Self::WriteGuard<'_, T>, Self::WriteError<'_, T>>
Attempts write access to the backend storage.
Auto Trait Implementations§
impl Freeze for MutexStorage
impl RefUnwindSafe for MutexStorage
impl Send for MutexStorage
impl StateClone for MutexStorage
impl StateCopy for MutexStorage
impl Sync for MutexStorage
impl Unpin for MutexStorage
impl UnsafeUnpin for MutexStorage
impl UnwindSafe for MutexStorage
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
Source§type Storage<T> = <Storage as SharedStorage>::Storage<T>
type Storage<T> = <Storage as SharedStorage>::Storage<T>
Concrete cell or lock type containing
SharedValue<T>.Source§type ReadGuard<'a, T: 'a> = <Storage as SharedStorage>::ReadGuard<'a, T>
where
Storage: 'a
type ReadGuard<'a, T: 'a> = <Storage as SharedStorage>::ReadGuard<'a, T> where Storage: 'a
Guard returned by read access.
Source§type WriteGuard<'a, T: 'a> = <Storage as SharedStorage>::WriteGuard<'a, T>
where
Storage: 'a
type WriteGuard<'a, T: 'a> = <Storage as SharedStorage>::WriteGuard<'a, T> where Storage: 'a
Guard returned by write access.