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 si;
29pub mod simdrive;
30pub mod traits;
31pub mod uc;
32pub mod utils;
33pub mod vehicle;
34
35/// List enabled features
36#[cfg_attr(feature = "pyo3", imports::pyfunction)]
37pub fn enabled_features() -> Vec<String> {
38 vec![
39 #[cfg(feature = "default")]
40 "default".into(),
41 #[cfg(feature = "resources")]
42 "resources".into(),
43 #[cfg(feature = "web")]
44 "web".into(),
45 #[cfg(feature = "serde-default")]
46 "serde-default".into(),
47 #[cfg(feature = "csv")]
48 "csv".into(),
49 #[cfg(feature = "json")]
50 "json".into(),
51 #[cfg(feature = "toml")]
52 "toml".into(),
53 #[cfg(feature = "yaml")]
54 "yaml".into(),
55 ]
56}