pub trait ParameterizedAlgorithm<T: Transcendental>: Algorithm<T> {
type Params: Clone + Send + Sync;
// Required methods
fn params(&self) -> &Self::Params;
fn set_params(&mut self, params: Self::Params);
// Provided method
fn set_parameter(
&mut self,
_name: &str,
_value: ParamValue,
) -> Result<(), &'static str> { ... }
}Expand description
An Algorithm with typed, settable parameters.
Extends the base Algorithm trait with the ability to get and set
a typed parameter struct (Params) and to update individual parameters
by name (for automation integration).
§Type parameter
Params — the concrete parameter type. Must be Clone + Send + Sync.
Different algorithm families use different structs (e.g. FilterParams
for DSP filters, StringParams for string models).
Required Associated Types§
Required Methods§
Sourcefn set_params(&mut self, params: Self::Params)
fn set_params(&mut self, params: Self::Params)
Replace all parameters atomically.
The implementation should recompute any derived coefficients.
Provided Methods§
Sourcefn set_parameter(
&mut self,
_name: &str,
_value: ParamValue,
) -> Result<(), &'static str>
fn set_parameter( &mut self, _name: &str, _value: ParamValue, ) -> Result<(), &'static str>
Set a single parameter by name (for automation / scripting).
Default: returns an error for any unrecognised name.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".