Struct fmu_runner::FmuInstance

source ·
pub struct FmuInstance<C: Borrow<FmuLibrary>> {
    pub lib: C,
    /* private fields */
}
Expand description

A simulation “instance”, ready to execute.

Fields§

§lib: C

The loaded dll library.

This is generic behind the Borrow trait so that the user can pass in a reference or different Cell types such as [Arc].

The presence of this enforces that the FmuLibrary will outlive the FmuInstance.

Implementations§

source§

impl<C: Borrow<FmuLibrary>> FmuInstance<C>

source

pub fn instantiate(lib: C, logging_on: bool) -> Result<Self, FmuError>

Call fmi2Instantiate() on the FMU library to start a new simulation instance.

source

pub fn get_set_state_capability( &self ) -> Option<FmuGetSetStateCapability<'_, C>>

source

pub fn serialize_state_capability( &self ) -> Option<FmuSerializeStateCapability<'_, C>>

source

pub fn get_types_platform(&self) -> &str

source

pub fn set_debug_logging( &self, logging_on: bool, log_categories: &[&str] ) -> Result<(), FmuError>

source

pub fn setup_experiment( &self, start_time: f64, stop_time: Option<f64>, tolerance: Option<f64> ) -> Result<(), FmuError>

source

pub fn enter_initialization_mode(&self) -> Result<(), FmuError>

source

pub fn exit_initialization_mode(&self) -> Result<(), FmuError>

source

pub fn get_reals<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable] ) -> Result<HashMap<&ScalarVariable, fmi2Real>, FmuError>

source

pub fn get_integers<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable] ) -> Result<HashMap<&ScalarVariable, fmi2Integer>, FmuError>

source

pub fn get_booleans<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable] ) -> Result<HashMap<&ScalarVariable, fmi2Integer>, FmuError>

source

pub fn set_reals( &self, value_map: &HashMap<&ScalarVariable, fmi2Real> ) -> Result<(), FmuError>

source

pub fn set_integers( &self, value_map: &HashMap<&ScalarVariable, fmi2Integer> ) -> Result<(), FmuError>

source

pub fn set_booleans( &self, value_map: &HashMap<&ScalarVariable, fmi2Integer> ) -> Result<(), FmuError>

source

pub fn do_step( &self, current_communication_point: fmi2Real, communication_step_size: fmi2Real, no_set_fmustate_prior_to_current_point: bool ) -> Result<(), FmuError>

Trait Implementations§

source§

impl<C: Borrow<FmuLibrary>> Drop for FmuInstance<C>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<C: Borrow<FmuLibrary>> Send for FmuInstance<C>

Auto Trait Implementations§

§

impl<C> RefUnwindSafe for FmuInstance<C>
where C: RefUnwindSafe,

§

impl<C> !Sync for FmuInstance<C>

§

impl<C> Unpin for FmuInstance<C>
where C: Unpin,

§

impl<C> UnwindSafe for FmuInstance<C>
where C: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.