pub trait TnuaConfigModifier<C> {
// Required method
fn modify_config(&self, config: &mut C);
}Expand description
Implement on payloads that can modify the configuration while the relevant action is running.
Note that the payload needs to have #[scheme(modify_basis_config)] on it in the control
scheme in order for this to take effect.
Required Methods§
Sourcefn modify_config(&self, config: &mut C)
fn modify_config(&self, config: &mut C)
Modify the configuration.
This does not touch the asset itself - it modifies a copy of the configuration stored in
the controller. Each time this method is called it works on a fresh copy of the
configuration - one that was just cloned from the asset and was not already modified by
this payload (though it could have been modified by previous payloads in the action
variant definition). This means that it’s okay to do things like config.field *= 2.0; -
it won’t cause the number in the field to explode.