scientific_workflow/lib.rs
1//! Rust primitives for reproducible scientific workflows.
2//!
3//! `scientific-workflow` provides the data and execution foundations needed to
4//! describe scientific systems, record their evolution, and organize scoped
5//! computational work. The crate is intentionally divided by responsibility:
6//! state representation, state time series, dispatch, persistence, and
7//! language bridges remain separate modules rather than accumulating behind
8//! one monolithic interface.
9//!
10//! # Current module
11//!
12//! The first implemented module is [`system_state`]. It provides:
13//!
14//! - JSON-defined, immutable field layouts;
15//! - heterogeneous concrete Rust payloads behind a typed API;
16//! - clone-free payload insertion, mutation, and extraction;
17//! - explicit deep cloning of complete states;
18//! - deterministic time-point metadata.
19//!
20//! Type erasure and boxing remain internal to that module. Downstream crates
21//! work with their original concrete payload types.
22//!
23//! # Basic use
24//!
25//! ```no_run
26//! use scientific_workflow::system_state::{StateSpec, TimePoint};
27//!
28//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
29//! let spec = StateSpec::load("state.json")?;
30//! let mut state = spec.empty(TimePoint::new(0));
31//!
32//! state.set("population", vec![10_u64, 20, 30])?;
33//! state
34//! .get_mut::<Vec<u64>>("population")?
35//! .push(40);
36//! let population = state.take::<Vec<u64>>("population")?;
37//!
38//! assert_eq!(population, vec![10, 20, 30, 40]);
39//! # Ok(())
40//! # }
41//! ```
42//!
43//! Future SSTS and dispatcher modules will build on the same ownership and
44//! module-boundary principles without changing the public state-value
45//! contract.
46
47pub mod system_state;