Struct libreda_db::property_storage::PropertyStore
source · pub struct PropertyStore<K>where
K: Hash + Eq,{
content: HashMap<K, PropertyValue>,
}Expand description
Look-up table for property values.
Fields§
§content: HashMap<K, PropertyValue>Implementations§
source§impl<K: Hash + Eq> PropertyStore<K>
impl<K: Hash + Eq> PropertyStore<K>
sourcepub fn insert<V: Into<PropertyValue>>(
&mut self,
key: K,
value: V
) -> Option<PropertyValue>
pub fn insert<V: Into<PropertyValue>>( &mut self, key: K, value: V ) -> Option<PropertyValue>
Insert a property. Returns the old property value if there was already a property stored under this key.
sourcepub fn get<Q>(&self, key: &Q) -> Option<&PropertyValue>where
K: Borrow<Q>,
Q: Eq + Hash + ?Sized,
pub fn get<Q>(&self, key: &Q) -> Option<&PropertyValue>where K: Borrow<Q>, Q: Eq + Hash + ?Sized,
Get a property value by the property key.
Trait Implementations§
source§impl<K> Clone for PropertyStore<K>where
K: Hash + Eq + Clone,
impl<K> Clone for PropertyStore<K>where K: Hash + Eq + Clone,
source§fn clone(&self) -> PropertyStore<K>
fn clone(&self) -> PropertyStore<K>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'de, K> Deserialize<'de> for PropertyStore<K>where
K: Hash + Eq + Deserialize<'de>,
impl<'de, K> Deserialize<'de> for PropertyStore<K>where K: Hash + Eq + Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more