1#![allow(clippy::field_reassign_with_default)]
9#![doc = document_features::document_features!()]
17
18#[macro_use]
19pub mod macros;
20
21extern crate self as fastsim_core;
22#[macro_use]
23extern crate uom;
24
25pub mod drive_cycle;
26pub mod error;
27pub mod gas_properties;
28pub mod imports;
29pub mod prelude;
30pub mod pyo3;
32pub mod si;
33pub mod simdrive;
34#[cfg(feature = "simdrivelabel")]
35pub mod simdrivelabel;
36pub mod traits;
37pub mod uc;
38pub mod utils;
39pub mod vehicle;
40
41#[cfg(feature = "compat")]
42pub mod compat;
43
44use semver::Version;
45use std::sync::LazyLock;
46
47pub static FASTSIM_VERSION: LazyLock<Version> = LazyLock::new(|| {
49 Version::parse(env!("CARGO_PKG_VERSION"))
50 .expect("CARGO_PKG_VERSION should always be valid semver")
51});
52
53pub(crate) fn current_fastsim_version() -> Version {
58 FASTSIM_VERSION.clone()
59}
60
61#[cfg_attr(feature = "pyo3", imports::pyfunction)]
63pub fn enabled_features() -> Vec<String> {
64 vec![
65 #[cfg(feature = "resources")]
66 "resources".into(),
67 #[cfg(feature = "web")]
68 "web".into(),
69 #[cfg(feature = "serde-default")]
70 "serde-default".into(),
71 #[cfg(feature = "csv")]
72 "csv".into(),
73 #[cfg(feature = "json")]
74 "json".into(),
75 #[cfg(feature = "toml")]
76 "toml".into(),
77 #[cfg(feature = "yaml")]
78 "yaml".into(),
79 ]
80}