Skip to main content

cognis_graph/
lib.rs

1//! # cognis-graph
2//!
3//! v2-beta graph engine: typed `Graph<S>` + Pregel superstep executor.
4//! `CompiledGraph<S>` implements `cognis_core::Runnable<S, S>`.
5
6#![warn(missing_docs)]
7#![warn(rust_2018_idioms)]
8
9pub mod analysis;
10pub mod audit;
11pub mod barrier;
12pub mod builder;
13pub mod channels;
14pub mod checkpoint;
15pub mod command;
16pub mod compiled;
17pub mod durability;
18pub(crate) mod engine;
19pub mod goto;
20pub mod metrics;
21pub mod node;
22pub mod reducer;
23pub mod snapshot;
24pub mod state;
25pub mod stream_mode;
26pub mod subgraph;
27pub(crate) mod validate;
28pub mod viz;
29
30pub use analysis::GraphAnalysis;
31pub use audit::{AuditEntry, AuditKind, AuditLog, AuditLogObserver, InMemoryAuditLog};
32pub use barrier::BarrierNode;
33pub use builder::{Graph, LinearBuilder};
34pub use channels::{
35    AnyValue, BinaryOp, Broadcast, Channel, ChannelRef, CustomChannel, Topic, Untracked,
36};
37#[cfg(feature = "postgres")]
38pub use checkpoint::PostgresCheckpointer;
39#[cfg(feature = "sqlite")]
40pub use checkpoint::SqliteCheckpointer;
41pub use checkpoint::{ActiveSnapshot, Checkpointer, InMemoryCheckpointer};
42pub use command::Command;
43pub use compiled::CompiledGraph;
44pub use durability::{Durability, DurabilityDecision, DurabilityHook};
45pub use goto::Goto;
46pub use metrics::{
47    GraphMetrics, MetricsObserver, NodeTiming, ProfilingObserver, ThresholdCallback,
48    ThresholdProfiler,
49};
50pub use node::{node_fn, Node, NodeCtx, NodeFn, NodeOut, NodeRetryPolicy};
51pub use reducer::{Add, Append, Custom, LastValue, Merge, Reducer};
52pub use snapshot::GraphSnapshot;
53pub use state::GraphState;
54pub use stream_mode::{StreamMode, StreamModes};
55pub use subgraph::Subgraph;
56
57/// Derive macro — generates `impl GraphState for <T>` with per-field reducers.
58/// The derive name shadows the trait name; both are imported via
59/// `use cognis_graph::GraphState;` because Rust allows a trait and a
60/// derive macro to share the same identifier (they live in different namespaces).
61pub use cognis_macros::GraphStateV2 as GraphState;
62
63/// Re-export of [`cognis_core`] — graph users import from this crate
64/// and `cognis_core::*` is implicitly in scope via re-export.
65pub use cognis_core;
66
67/// Re-export of the [`schemars`] crate (via cognis-core).
68pub use cognis_core::schemars;