Struct libreda_db::property_storage::PropertyStore[][src]

pub struct PropertyStore<K> where
    K: Hash + Eq
{ /* fields omitted */ }

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]

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]

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]

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]

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]

impl<K: Debug> Debug for PropertyStore<K> where
    K: Hash + Eq
[src]

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

impl<K> UnwindSafe for PropertyStore<K> where
    K: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.