[−][src]Trait restor::Unit
The type erasure trait for restor
.
This contains an interface for interacting with a StorageUnit
wrapper, and should be ignored by the end user.
Exposed here are two types:
Borrowed
which must deref to adyn Any
Ref
in the case ofDynamicStorage
MappedRwLockReadGuard
in the case ofRwLockStorage
MappedMutexGuard
in the case ofMutexStorage
MutBorrowed
which must deref_mut to adyn Any
RefMut
in the case ofDynamicStorage
MappedRwLockWriteGuard
in the case ofMutexStorage
MappedMutexGuard
in the case ofMutexStorage
Associated Types
type Borrowed: Deref<Target = dyn Any> + 'a
type MutBorrowed: Deref<Target = dyn Any> + DerefMut + 'a
Required methods
fn insert_any(&self, new: Box<dyn Any>) -> Option<(Box<dyn Any>, ErrorDesc)>
Inserts an owned piece of data into storage, returning it if it cannot be inserted.
fn waiting_insert(&self, new: Box<dyn Any>) -> Option<(Box<dyn Any>, ErrorDesc)> where
Self::Borrowed: Waitable,
Self::MutBorrowed: Waitable,
Self::Borrowed: Waitable,
Self::MutBorrowed: Waitable,
Waits to insert a value into the storage.
fn storage(&'a self) -> Result<Self::Borrowed, ErrorDesc>
Returns an immutable lock to the internal StorageUnit<T>
fn storage_mut(&'a self) -> Result<Self::MutBorrowed, ErrorDesc>
Returns a mutable lock to the internal StorageUnit<T>
fn waiting_storage(&'a self) -> Self::Borrowed where
Self::Borrowed: Waitable,
Self::Borrowed: Waitable,
fn waiting_storage_mut(&'a self) -> Self::MutBorrowed where
Self::MutBorrowed: Waitable,
Self::MutBorrowed: Waitable,
fn id(&self) -> TypeId
Returns the TypeId
of the type of data contained in the
StorageUnit<T>
(So the TypeId
of T
).