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§
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
Returns the model name
Sourcefn version_string(&self) -> &str
fn version_string(&self) -> &str
Returns the FMI version as a string
Sourcefn deserialize(xml: &str) -> Result<Self, Error>
fn deserialize(xml: &str) -> Result<Self, Error>
Deserialize the model description from XML
Provided Methods§
Sourcefn version(&self) -> Result<Version, Error>
fn version(&self) -> Result<Version, Error>
Returns the parsed FMI version as a semver::Version
Sourcefn major_version(&self) -> Result<MajorVersion, Error>
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.