pub trait Automaton:
Send
+ Sync
+ Debug {
type Internal: Clone + Send + Sync + 'static;
type Action: Debug + Clone + Send + Sync + Default + 'static;
// Required methods
fn step(
&self,
internal: &mut Self::Internal,
current: &ParamValue,
time: Time,
action: &Self::Action,
) -> ParamValue;
fn initial_internal(&self) -> Self::Internal;
fn name(&self) -> &str;
// Provided method
fn reset(&self) -> Self::Internal { ... }
}Expand description
Core trait for automatons — stateful signal generators that advance per step.
Required Associated Types§
Required Methods§
Sourcefn step(
&self,
internal: &mut Self::Internal,
current: &ParamValue,
time: Time,
action: &Self::Action,
) -> ParamValue
fn step( &self, internal: &mut Self::Internal, current: &ParamValue, time: Time, action: &Self::Action, ) -> ParamValue
Advances the automaton by one step, producing a new output value.
internal holds mutable state, current is the last output value,
time is the elapsed time in seconds, and action is an optional trigger.
Sourcefn initial_internal(&self) -> Self::Internal
fn initial_internal(&self) -> Self::Internal
Returns the automaton’s initial internal state (at time zero).
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".