pub struct StoreRegistry<T: 'static>(/* private fields */);Expand description
StoreRegistry
Implementations§
Source§impl<T: 'static> StoreRegistry<T>
impl<T: 'static> StoreRegistry<T>
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = (&'static str, &'static LocalKey<RefCell<T>>)>
pub fn iter( &self, ) -> impl Iterator<Item = (&'static str, &'static LocalKey<RefCell<T>>)>
Iterate registered store names and thread-local keys.
Sourcepub fn for_each<R>(&self, f: impl FnMut(&'static str, &T) -> R)
pub fn for_each<R>(&self, f: impl FnMut(&'static str, &T) -> R)
Borrow each registered store immutably.
Sourcepub fn register(
&mut self,
name: &'static str,
accessor: &'static LocalKey<RefCell<T>>,
)
pub fn register( &mut self, name: &'static str, accessor: &'static LocalKey<RefCell<T>>, )
Register a thread-local store accessor under a path.
Sourcepub fn try_get_store(
&self,
path: &str,
) -> Result<&'static LocalKey<RefCell<T>>, Error>
pub fn try_get_store( &self, path: &str, ) -> Result<&'static LocalKey<RefCell<T>>, Error>
Look up a store accessor by path.
Trait Implementations§
Source§impl<T: Default + 'static> Default for StoreRegistry<T>
impl<T: Default + 'static> Default for StoreRegistry<T>
Source§fn default() -> StoreRegistry<T>
fn default() -> StoreRegistry<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for StoreRegistry<T>
impl<T> RefUnwindSafe for StoreRegistry<T>
impl<T> Send for StoreRegistry<T>
impl<T> Sync for StoreRegistry<T>
impl<T> Unpin for StoreRegistry<T>
impl<T> UnwindSafe for StoreRegistry<T>
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