1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! The AstRS dataflow graph model.
//!
//! What a validated manifest becomes before anything is spawned
//! (blueprint §5.2, §7.7):
//!
//! - The graph model: nodes, ports, edges, virtual sources and modules —
//! see [`DataflowGraph::from_manifest`].
//! - Edge type checking against declared type URNs, with `type: any` as an
//! explicit opt-out rather than a default — see [`EdgeTypeStatus`] and
//! [`DataflowGraph::diagnostics`].
//! - Stable topological metadata: strongly-connected-component (cycle)
//! detection, and service/action pattern pairing — see [`Scc`] and
//! [`PatternPair`].
//! - The placement planner mapping nodes onto daemons and deciding which
//! edges are same-host versus cross-host — see [`plan_placement`].
//! - Visualization to mermaid and DOT for `astrs graph` — see [`to_mermaid`]
//! and [`to_dot`].
//! - Graph diffing for dynamic topology changes (`astrs node add/remove`)
//! — see [`diff()`] and [`apply()`].
//!
//! # Quick start
//!
//! ```
//! use astrs_graph::DataflowGraph;
//! use astrs_manifest::Manifest;
//!
//! let yaml = "\
//! nodes:
//! - id: camera
//! path: ./camera
//! outputs: [frames]
//! - id: detector
//! path: ./detector
//! inputs:
//! frames: camera/frames
//! ";
//! let manifest = Manifest::from_yaml_str(yaml)?;
//! manifest.validate()?;
//!
//! let (graph, construction_diagnostics) = DataflowGraph::from_manifest(&manifest)?;
//! assert!(construction_diagnostics.is_empty());
//! assert_eq!(graph.node_count(), 2);
//! assert_eq!(graph.edge_count(), 1);
//! assert!(graph.diagnostics().is_empty()); // no type mismatches, cycles, ...
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! # Scope
//!
//! This crate builds its graph from a [`Manifest`](astrs_manifest::Manifest)
//! as that crate currently defines it. Module expansion (blueprint §8.5 —
//! inlining a `module:`-sourced node's referenced sub-graph before this
//! crate ever sees it) is `astrs-manifest`'s responsibility, tracked there;
//! this crate's construction path is written to accept whatever expanded
//! (or not-yet-expandable) manifest shape that crate produces.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Scc;
pub use EdgeTypeStatus;
pub use ;