pub trait FmiVariableBuilder: Sized {
type Var: AbstractVariableTrait;
type Start;
// Required method
fn finish(builder: VariableBuilder<Self>) -> Self::Var;
// Provided method
fn variable(
name: impl Into<String>,
value_reference: u32,
) -> VariableBuilder<Self> { ... }
}Expand description
Trait for types that can be used to build FMI variables.
Implementors define:
Var: The concrete FMI variable type to create (e.g.,FmiFloat64,FmiBoolean)Start: The type for start values (typicallyStartValue<T>)variable(): Creates a new builder (default implementation provided)finish(): Type-specific method to extract relevant fields and create the concrete variable
Required Associated Types§
type Var: AbstractVariableTrait
type Start
Required Methods§
Sourcefn finish(builder: VariableBuilder<Self>) -> Self::Var
fn finish(builder: VariableBuilder<Self>) -> Self::Var
Type-specific finish method that creates the concrete variable type.
This method receives the complete builder and extracts only the fields relevant to the specific variable type being created.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.