Trait libreda_pnr::db::WithProperties [−][src]
A trait for associating user defined properties with a type.
Associated Types
Loading content...Required methods
pub 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
.
pub 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
pub fn property<Q>(&self, key: &Q) -> Option<PropertyValue> where
Q: Eq + Hash + ?Sized,
Self::Key: Borrow<Q>,
[src]
Q: Eq + Hash + ?Sized,
Self::Key: Borrow<Q>,
Get a property value by the property key.
pub fn property_str<Q>(&self, key: &Q) -> Option<Rc<String>> where
Q: Eq + Hash + ?Sized,
Self::Key: Borrow<Q>,
[src]
Q: Eq + Hash + ?Sized,
Self::Key: Borrow<Q>,
Get a string property value by key.
If the property value is not a string None
is returned.
pub fn set_property<V>(&self, key: Self::Key, value: V) -> Option<PropertyValue> where
V: Into<PropertyValue>,
[src]
V: Into<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
pub fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<<Layout as WithProperties>::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<<Layout as WithProperties>::Key>>) -> R,
pub fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<<Layout as WithProperties>::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<<Layout as WithProperties>::Key>) -> R,
impl<C> WithProperties for Cell<C> where
C: CoordinateType,
[src]
C: CoordinateType,
type Key = String
pub fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<<Cell<C> as WithProperties>::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<<Cell<C> as WithProperties>::Key>>) -> R,
pub fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<<Cell<C> as WithProperties>::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<<Cell<C> as WithProperties>::Key>) -> R,
impl<C> WithProperties for CellInstance<C> where
C: CoordinateType,
[src]
C: CoordinateType,
type Key = String
pub fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<<CellInstance<C> as WithProperties>::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<<CellInstance<C> as WithProperties>::Key>>) -> R,
pub fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<<CellInstance<C> as WithProperties>::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<<CellInstance<C> as WithProperties>::Key>) -> R,
impl<C> WithProperties for Shape<C> where
C: CoordinateType,
[src]
C: CoordinateType,
type Key = String
pub fn with_properties<F, R>(&self, f: F) -> R where
F: FnOnce(Option<&PropertyStore<<Shape<C> as WithProperties>::Key>>) -> R,
[src]
F: FnOnce(Option<&PropertyStore<<Shape<C> as WithProperties>::Key>>) -> R,
pub fn with_properties_mut<F, R>(&self, f: F) -> R where
F: FnOnce(&mut PropertyStore<<Shape<C> as WithProperties>::Key>) -> R,
[src]
F: FnOnce(&mut PropertyStore<<Shape<C> as WithProperties>::Key>) -> R,