Expand description
struct for collecting values of any type with a string key
Implementations§
source§impl<K> Baggie<K>where
K: Eq + Hash + Default,
impl<K> Baggie<K>where
K: Eq + Hash + Default,
sourcepub fn get<T: 'static, Q>(&self, key: &Q) -> Option<&T>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
pub fn get<T: 'static, Q>(&self, key: &Q) -> Option<&T>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
Get a reference to something in the baggie
sourcepub fn get_mut<T: 'static, Q>(&mut self, key: &Q) -> Option<&mut T>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
pub fn get_mut<T: 'static, Q>(&mut self, key: &Q) -> Option<&mut T>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
Get a mutable reference to something in the baggie
sourcepub fn keys(&self) -> Keys<'_, K, Box<dyn Any>>
pub fn keys(&self) -> Keys<'_, K, Box<dyn Any>>
An iterator visiting all keys in arbitrary order.