Trait gut::mesh::attrib::AttribPromote [−][src]
pub trait AttribPromote<SI, TI> where
SI: AttribIndex<Self>,
TI: AttribIndex<Self>, {
fn attrib_promote<U, F>(
&mut self,
name: &'a str,
combine: F
) -> Result<&Attribute<TI>, Error>
where
U: 'static + Clone,
F: for<'b> FnMut(&'b mut U, &'b U);
}
Expand description
Promote attributes from one topology to another.
Required methods
Promote the given attribute from source topology SI
to target topology TI
.
A mutable reference to the resulting attribute is returned upon success.
Collisions are handled using the given combine
closure which takes two attribute
components of type T
and combines them into a single T
to be written to the target
topology attribute.
If an attribute with the same name already exists at the target topology, it will be combined with the promoted attribute. If that attribute has the wrong type, an error is returned.