Skip to main content

FmiModelDescription

Trait FmiModelDescription 

Source
pub trait FmiModelDescription: Sized {
    // Required methods
    fn model_name(&self) -> &str;
    fn version_string(&self) -> &str;
    fn deserialize(xml: &str) -> Result<Self, Error>;
    fn serialize(&self) -> Result<String, Error>;

    // Provided methods
    fn version(&self) -> Result<Version, Error> { ... }
    fn major_version(&self) -> Result<MajorVersion, Error> { ... }
}
Expand description

A trait common between all FMI schema versions

Required Methods§

Source

fn model_name(&self) -> &str

Returns the model name

Source

fn version_string(&self) -> &str

Returns the FMI version as a string

Source

fn deserialize(xml: &str) -> Result<Self, Error>

Deserialize the model description from XML

Source

fn serialize(&self) -> Result<String, Error>

Serialize the model description to XML

Provided Methods§

Source

fn version(&self) -> Result<Version, Error>

Returns the parsed FMI version as a semver::Version

Source

fn major_version(&self) -> Result<MajorVersion, Error>

Returns the parsed FMI version as a MajorVersion

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.

Implementors§