Skip to main content

Model

Struct Model 

Source
pub struct Model {
    pub entry: &'static MachineEntry,
    pub config_text: String,
    pub lang: String,
    pub variables: Vec<Variable>,
    pub guid: String,
    pub xml: String,
    pub fmi: u8,
}
Expand description

An FMU’s content apart from its binaries: the machine, the config as text, and the model description generated from them.

Fields§

§entry: &'static MachineEntry§config_text: String§lang: String§variables: Vec<Variable>§guid: String

Changes whenever the model description does: a hash of it.

§xml: String§fmi: u8

The FMI version of the model description: 2 or 3.

Implementations§

Source§

impl Model

Source

pub fn new( entry: &'static MachineEntry, config_text: &str, lang: &str, ) -> Result<Self, ConfigError>

An FMI 2.0 FMU. config_text is read as a config file (load_config); lang is the language of the descriptions.

Source

pub fn with_fmi( entry: &'static MachineEntry, config_text: &str, lang: &str, fmi: u8, ) -> Result<Self, ConfigError>

As new, for FMI 3.0 if fmi is 3 and FMI 2.0 otherwise. In 3.0 the GUID is the instantiation token.

Source

pub fn files(&self) -> Vec<(String, Vec<u8>)>

The files of the FMU apart from its binaries, as (path in the archive, content).

Auto Trait Implementations§

§

impl Freeze for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.