Skip to main content

tramli/
lib.rs

1//! # tramli
2//!
3//! Constrained flow engine — state machines that prevent invalid transitions at build time.
4//! Intentionally synchronous. See `docs/async-integration.md` for async I/O patterns.
5
6mod clone_any;
7mod context;
8mod data_flow_graph;
9mod definition;
10mod engine;
11mod error;
12mod instance;
13mod mermaid;
14pub mod pipeline;
15mod store;
16pub mod sub_flow;
17mod types;
18
19pub use clone_any::CloneAny;
20pub use context::FlowContext;
21pub use data_flow_graph::{DataFlowGraph, NodeInfo};
22pub use definition::{FlowDefinition, Builder, FromBuilder, BranchBuilder, SubFlowBuilder};
23pub use engine::{FlowEngine, TransitionLogEntry, ErrorLogEntry, GuardLogEntry};
24pub use error::FlowError;
25pub use instance::FlowInstance;
26pub use mermaid::MermaidGenerator;
27pub use store::{FlowStore, InMemoryFlowStore, TransitionRecord};
28pub use types::*;
29
30/// Shorthand for creating a Vec<TypeId> from type names.
31/// Use in `requires()` and `produces()` implementations.
32#[macro_export]
33macro_rules! data_types {
34    ($($t:ty),* $(,)?) => {
35        vec![$(std::any::TypeId::of::<$t>()),*]
36    }
37}
38
39/// Alias for `data_types!`. Kept for backward compatibility.
40#[macro_export]
41macro_rules! requires {
42    ($($t:ty),* $(,)?) => {
43        vec![$(std::any::TypeId::of::<$t>()),*]
44    }
45}