Struct libreda_db::property_storage::PropertyStore [−][src]
Look-up table for property values.
Implementations
impl<K: Hash + Eq> PropertyStore<K>[src]
pub fn new() -> Self[src]
Create an empty property store.
pub fn insert<V: Into<PropertyValue>>(
&mut self,
key: K,
value: V
) -> Option<PropertyValue>[src]
&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.
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&PropertyValue> where
K: Borrow<Q>,
Q: Eq + Hash, [src]
K: Borrow<Q>,
Q: Eq + Hash,
Get a property value by the property key.
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where
K: Borrow<Q>,
Q: Eq + Hash, [src]
K: Borrow<Q>,
Q: Eq + Hash,
Check if the key is contained in this property store.
pub fn get_string<Q: ?Sized>(&self, key: &Q) -> Option<&Rc<String>> where
K: Borrow<Q>,
Q: Eq + Hash, [src]
K: Borrow<Q>,
Q: Eq + Hash,
Get a string property value by key.
If the property value is not a string None is returned.
Trait Implementations
impl<K: Clone> Clone for PropertyStore<K> where
K: Hash + Eq, [src]
K: Hash + Eq,
fn clone(&self) -> PropertyStore<K>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<K: Debug> Debug for PropertyStore<K> where
K: Hash + Eq, [src]
K: Hash + Eq,
impl<K: Hash + Eq> Default for PropertyStore<K>[src]
Auto Trait Implementations
impl<K> !RefUnwindSafe for PropertyStore<K>
impl<K> !Send for PropertyStore<K>
impl<K> !Sync for PropertyStore<K>
impl<K> Unpin for PropertyStore<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for PropertyStore<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,