Skip to main content

rill_graph/
lib.rs

1//! # Rill Graph — Static DAG Signal Graph
2//!
3//! This crate provides an immutable signal graph with static topology.
4//! Build once with `GraphBuilder`. The graph is a pure topology description
5//! — processing is driven by port-level methods (`pre_process`,
6//! `snapshot_feedback`, `propagate`) called from external code.
7//!
8//! ## Key Features
9//!
10//! - **Static DAG topology** — connections are fixed after build
11//! - **Kahn's algorithm** — automatic topological sort with cycle detection
12//! - **Auto FanOut/FanIn** — connections classified by topology (user never chooses)
13//! - **Port-owned routing** — downstream connections and feedback state live on ports
14//! - **Copy-based buffer routing** — separate input/output buffer pools (zero-copy planned)
15//! - **Safe Rust** — no `unsafe` code
16
17#![warn(missing_docs)]
18#![deny(unsafe_code)]
19
20mod graph;
21
22/// Real-time safe signal engine for driving an [`SignalGraph`].
23pub mod engine;
24
25/// Node factory and registry for constructing nodes by type name.
26pub mod registry;
27
28/// Graph serialization (JSON / CBOR). Feature-gated behind `serialization`.
29#[cfg(feature = "serialization")]
30pub mod serialization;
31
32pub use graph::{SignalGraph, BuildError, ConnectionKind, GraphBuilder};
33pub use registry::{NodeConstructor, NodeRegistry, RegistryError};
34
35/// Prelude for convenient imports
36pub mod prelude {
37    pub use crate::{SignalGraph, GraphBuilder, NodeConstructor, NodeRegistry, RegistryError};
38    pub use rill_core::prelude::*;
39}