pub struct FmuInstance<C: Borrow<FmuLibrary>> {
pub lib: C,
/* private fields */
}Expand description
A simulation “instance”, ready to execute.
Fields§
§lib: CThe 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>
impl<C: Borrow<FmuLibrary>> FmuInstance<C>
Sourcepub fn instantiate(lib: C, logging_on: bool) -> Result<Self, FmuError>
pub fn instantiate(lib: C, logging_on: bool) -> Result<Self, FmuError>
Call fmi2Instantiate() on the FMU library to start a new simulation instance.
pub fn get_set_state_capability( &self, ) -> Option<FmuGetSetStateCapability<'_, C>>
pub fn serialize_state_capability( &self, ) -> Option<FmuSerializeStateCapability<'_, C>>
pub fn get_types_platform(&self) -> &str
pub fn set_debug_logging( &self, logging_on: bool, log_categories: &[&str], ) -> Result<(), FmuError>
pub fn setup_experiment( &self, start_time: f64, stop_time: Option<f64>, tolerance: Option<f64>, ) -> Result<(), FmuError>
pub fn enter_initialization_mode(&self) -> Result<(), FmuError>
pub fn exit_initialization_mode(&self) -> Result<(), FmuError>
pub fn get_reals<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable], ) -> Result<HashMap<&ScalarVariable, fmi2Real>, FmuError>
pub fn get_integers<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable], ) -> Result<HashMap<&ScalarVariable, fmi2Integer>, FmuError>
pub fn get_booleans<'fmu>( &'fmu self, signals: &[&'fmu ScalarVariable], ) -> Result<HashMap<&ScalarVariable, fmi2Integer>, FmuError>
pub fn set_reals( &self, value_map: &HashMap<&ScalarVariable, fmi2Real>, ) -> Result<(), FmuError>
pub fn set_integers( &self, value_map: &HashMap<&ScalarVariable, fmi2Integer>, ) -> Result<(), FmuError>
pub fn set_booleans( &self, value_map: &HashMap<&ScalarVariable, fmi2Integer>, ) -> Result<(), FmuError>
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>
impl<C: Borrow<FmuLibrary>> Drop for FmuInstance<C>
impl<C: Borrow<FmuLibrary>> Send for FmuInstance<C>
Auto Trait Implementations§
impl<C> Freeze for FmuInstance<C>where
C: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more