Skip to main content

SharedStorageView

Trait SharedStorageView 

Source
pub trait SharedStorageView {
    type Storage<T>;
    type ReadGuard<'a, T>: Deref<Target = SharedValue<T>>
       where Self: 'a,
             T: 'a;
    type WriteGuard<'a, T>: DerefMut<Target = SharedValue<T>>
       where Self: 'a,
             T: 'a;
}
Expand description

Guard types used by runtime-erased state views.

This is the part needed by StorageStateRef and StorageStateMut. Full shared containers also implement SharedStorage, which adds construction and borrow methods.

Required Associated Types§

Source

type Storage<T>

Concrete cell or lock type containing SharedValue<T>.

Source

type ReadGuard<'a, T>: Deref<Target = SharedValue<T>> where Self: 'a, T: 'a

Guard returned by read access.

Source

type WriteGuard<'a, T>: DerefMut<Target = SharedValue<T>> where Self: 'a, T: 'a

Guard returned by write access.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SharedStorageView for DynStorage

Source§

type Storage<T> = SharedValue<T>

Source§

type ReadGuard<'a, T> = &'a SharedValue<T> where T: 'a

Source§

type WriteGuard<'a, T> = &'a mut SharedValue<T> where T: 'a

Source§

impl<Storage> SharedStorageView for Storage
where Storage: SharedStorage,

Source§

type Storage<T> = <Storage as SharedStorage>::Storage<T>

Source§

type ReadGuard<'a, T> = <Storage as SharedStorage>::ReadGuard<'a, T> where Storage: 'a, T: 'a

Source§

type WriteGuard<'a, T> = <Storage as SharedStorage>::WriteGuard<'a, T> where Storage: 'a, T: 'a