pub struct RwLockStorage;Expand description
SharedStorage implementation backed by RwLock.
Trait Implementations§
Source§type Storage<T> = RwLock<SharedValue<T>>
type Storage<T> = RwLock<SharedValue<T>>
Concrete cell or lock type containing
SharedValue<T>.Source§type ReadGuard<'a, T> = RwLockReadGuard<'a, SharedValue<T>>
where
T: 'a
type ReadGuard<'a, T> = RwLockReadGuard<'a, SharedValue<T>> where T: 'a
Guard returned by read access.
Source§type WriteGuard<'a, T> = RwLockWriteGuard<'a, SharedValue<T>>
where
T: 'a
type WriteGuard<'a, T> = RwLockWriteGuard<'a, SharedValue<T>> where T: 'a
Guard returned by write access.
Source§type ReadError<'a, T> = TryLockError<RwLockReadGuard<'a, SharedValue<T>>>
where
T: 'a
type ReadError<'a, T> = TryLockError<RwLockReadGuard<'a, SharedValue<T>>> where T: 'a
Error returned by read access.
Source§type WriteError<'a, T> = TryLockError<RwLockWriteGuard<'a, SharedValue<T>>>
where
T: 'a
type WriteError<'a, T> = TryLockError<RwLockWriteGuard<'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 RwLockStorage
impl RefUnwindSafe for RwLockStorage
impl Send for RwLockStorage
impl StateClone for RwLockStorage
impl StateCopy for RwLockStorage
impl Sync for RwLockStorage
impl Unpin for RwLockStorage
impl UnsafeUnpin for RwLockStorage
impl UnwindSafe for RwLockStorage
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.