pub struct StateRegistry {
client_managed: RwLock<HashMap<TypeId, Box<dyn Any + Send + Sync>>>,
}
Expand description
A registry that contains repositories for different types of items. These repositories can be either managed by the client or by the SDK itself.
Fields§
§client_managed: RwLock<HashMap<TypeId, Box<dyn Any + Send + Sync>>>
Implementations§
Source§impl StateRegistry
impl StateRegistry
Sourcepub fn register_client_managed<T: RepositoryItem>(
&self,
value: Arc<dyn Repository<T>>,
)
pub fn register_client_managed<T: RepositoryItem>( &self, value: Arc<dyn Repository<T>>, )
Registers a client-managed repository into the map, associating it with its type.
Sourcepub fn get_client_managed<T: RepositoryItem>(
&self,
) -> Option<Arc<dyn Repository<T>>>
pub fn get_client_managed<T: RepositoryItem>( &self, ) -> Option<Arc<dyn Repository<T>>>
Retrieves a client-managed repository from the map given its type.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StateRegistry
impl RefUnwindSafe for StateRegistry
impl Send for StateRegistry
impl Sync for StateRegistry
impl Unpin for StateRegistry
impl UnwindSafe for StateRegistry
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