Skip to main content

FmiVariableBuilder

Trait FmiVariableBuilder 

Source
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 (typically StartValue<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§

Required Methods§

Source

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§

Source

fn variable( name: impl Into<String>, value_reference: u32, ) -> VariableBuilder<Self>

Create a new variable builder with the given name.

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.

Implementations on Foreign Types§

Source§

impl FmiVariableBuilder for bool

Source§

type Var = FmiBoolean

Source§

type Start = StartValue<bool>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for f32

Source§

type Var = FmiFloat32

Source§

type Start = StartValue<f32>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for f64

Source§

type Var = FmiFloat64

Source§

type Start = StartValue<f64>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for i8

Source§

type Var = FmiInt8

Source§

type Start = StartValue<i8>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for i16

Source§

type Var = FmiInt16

Source§

type Start = StartValue<i16>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for i32

Source§

type Var = FmiInt32

Source§

type Start = StartValue<i32>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for u8

Source§

type Var = FmiUInt8

Source§

type Start = StartValue<u8>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for u16

Source§

type Var = FmiUInt16

Source§

type Start = StartValue<u16>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for u32

Source§

type Var = FmiUInt32

Source§

type Start = StartValue<u32>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl FmiVariableBuilder for String

Source§

type Var = FmiString

Source§

type Start = StartValue<String>

Source§

fn finish(builder: VariableBuilder<Self>) -> Self::Var

Source§

impl<T> FmiVariableBuilder for Vec<T>

Source§

impl<const N: usize, T> FmiVariableBuilder for [T; N]

Implementors§