fastsim_core/
lib.rs

1//! Core crate for performing FASTSim simulations.
2//!
3//! # Crate Specific Coding Practices
4//! - `#[non_exhaustive]` macro is invoked to force any downstream crate to use
5//!    the `Init` trait to initialize structs that implement this macro
6//! - `#[fastsim_api]` -- used to expose the struct to python and provides assorted other features related to usability
7
8#![allow(clippy::field_reassign_with_default)]
9// TODO: uncomment when docs are somewhat mature to check for missing docs
10// #![warn(missing_docs)]
11// #![warn(missing_docs_in_private_items)]
12
13//! Crate containing models for second-by-second fuel and energy consumption of simulation
14//! of vehicles
15//! # Feature Flags
16#![doc = document_features::document_features!()]
17
18#[macro_use]
19pub mod macros;
20
21pub mod drive_cycle;
22pub mod error;
23pub mod gas_properties;
24pub mod imports;
25pub mod prelude;
26// #[cfg(feature = "pyo3")] -- feature gate provided inside module
27pub mod pyo3;
28pub mod resources;
29pub mod si;
30pub mod simdrive;
31pub mod traits;
32pub mod uc;
33pub mod utils;
34pub mod vehicle;
35
36/// List enabled features
37#[cfg_attr(feature = "pyo3", imports::pyfunction)]
38pub fn enabled_features() -> Vec<String> {
39    vec![
40        #[cfg(feature = "default")]
41        "default".into(),
42        #[cfg(feature = "resources")]
43        "resources".into(),
44        #[cfg(feature = "web")]
45        "web".into(),
46        #[cfg(feature = "serde-default")]
47        "serde-default".into(),
48        #[cfg(feature = "csv")]
49        "csv".into(),
50        #[cfg(feature = "json")]
51        "json".into(),
52        #[cfg(feature = "toml")]
53        "toml".into(),
54        #[cfg(feature = "yaml")]
55        "yaml".into(),
56    ]
57}