Trait meshx::attrib::AttribPromote
source · pub trait AttribPromote<SI, TI>{
// Required method
fn attrib_promote<'a, U, F>(
&mut self,
name: &'a str,
combine: F
) -> Result<&Attribute<TI>, Error>
where U: Clone + 'static,
F: for<'b> FnMut(&'b mut U, &'b U);
}
Expand description
Promote attributes from one topology to another.
Required Methods§
sourcefn attrib_promote<'a, U, F>(
&mut self,
name: &'a str,
combine: F
) -> Result<&Attribute<TI>, Error>
fn attrib_promote<'a, U, F>( &mut self, name: &'a str, combine: F ) -> Result<&Attribute<TI>, Error>
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.
Object Safety§
This trait is not object safe.