Trait libreda_db::property_storage::WithProperties [−][src]
A trait for associating user defined properties with a type.
Associated Types
Loading content...Required methods
fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
Call a function with maybe the property storage as argument.
The property store might not always be initialized. For instance for
objects without any defined properties, it will likely be None
.
fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
Get mutable reference to the property storage.
Provided methods
fn property<Q: ?Sized>(&self, key: &Q) -> Option<PropertyValue> where
Self::Key: Borrow<Q>,
Q: Eq + Hash,
[src]
Self::Key: Borrow<Q>,
Q: Eq + Hash,
Get a property value by the property key.
fn property_str<Q: ?Sized>(&self, key: &Q) -> Option<Rc<String>> where
Self::Key: Borrow<Q>,
Q: Eq + Hash,
[src]
Self::Key: Borrow<Q>,
Q: Eq + Hash,
Get a string property value by key.
If the property value is not a string None
is returned.
fn set_property<V: Into<PropertyValue>>(
&self,
key: Self::Key,
value: V
) -> Option<PropertyValue>
[src]
&self,
key: Self::Key,
value: V
) -> Option<PropertyValue>
Insert a property. Returns the old property value if there was already a property stored under this key.
Implementors
impl WithProperties for Layout
[src]
type Key = String
fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
impl<C: CoordinateType> WithProperties for Cell<C>
[src]
type Key = String
fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
impl<C: CoordinateType> WithProperties for CellInstance<C>
[src]
type Key = String
fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
impl<C: CoordinateType> WithProperties for Shape<C>
[src]
type Key = String
fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<Self::Key>>) -> R,
fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<Self::Key>) -> R,