pub(crate) struct AnyMap {
inner: RwLock<HashMap<TypeId, Box<dyn Any + Send + Sync>>>,
}Expand description
A concurrent map holding type-erased values, each keyed by its own type.
Fields§
§inner: RwLock<HashMap<TypeId, Box<dyn Any + Send + Sync>>>Implementations§
Source§impl AnyMap
impl AnyMap
Sourcepub(crate) fn insert<V: Send + Sync + 'static>(&self, value: V)
pub(crate) fn insert<V: Send + Sync + 'static>(&self, value: V)
Inserts a value under its own type, replacing any existing value of that type.
The key is the static type of value at the call site, so any coercion has to happen
before inserting: Arc<ConcreteRepo> and Arc<dyn Repository<T>> are different keys.
Auto Trait Implementations§
impl !Freeze for AnyMap
impl RefUnwindSafe for AnyMap
impl Send for AnyMap
impl Sync for AnyMap
impl Unpin for AnyMap
impl UnsafeUnpin for AnyMap
impl UnwindSafe for AnyMap
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more