Skip to main content

jellyflow_core/
lib.rs

1//! Headless graph primitives for Jellyflow.
2//!
3//! This crate owns the portable graph document model, stable IDs, type descriptors, and interaction
4//! policy value types shared by higher-level runtimes and UI adapters. It must stay free of Fret UI,
5//! renderer, platform, and windowing dependencies.
6
7#![deny(unsafe_code)]
8
9pub mod core;
10pub mod interaction;
11pub mod ops;
12pub mod types;
13
14pub use core::{
15    Binding, BindingEndpoint, BindingId, CanvasPoint, CanvasRect, CanvasSize, Edge, EdgeId,
16    EdgeKind, EdgeLabelAnchor, EdgeReconnectable, EdgeReconnectableEndpoint, EdgeRouteKind,
17    EdgeViewDescriptor, Graph, GraphBuilder, GraphElementIter, GraphElementKeys,
18    GraphElementValues, GraphElements, GraphId, GraphImport, GraphImportClosure, GraphImportError,
19    GraphLocalBindingTarget, GraphValidationError, GraphValidationReport, Group, GroupId, Node,
20    NodeExtent, NodeId, NodeKindKey, NodeOrigin, Port, PortCapacity, PortDirection, PortId,
21    PortKey, PortKind, SourceAnchor, StickyNote, StickyNoteId, Symbol, SymbolId,
22};
23pub use interaction::{
24    NodeGraphConnectionMode, NodeGraphDragHandleMode, NodeGraphModifierKey, NodeGraphModifiers,
25};
26pub use ops::{
27    ApplyError, DEFAULT_HISTORY_LIMIT, EdgeEndpoints, GraphFragment, GraphHistory,
28    GraphMutationFootprint, GraphOp, GraphOpBuilderExt, GraphTransaction, IdRemapSeed, IdRemapper,
29    PasteTuning, find_invalid_size_in_tx, find_non_finite_in_tx, normalize_transaction,
30};
31pub use types::{
32    DefaultTypeCompatibility, TypeCompatibility, TypeCompatibilityResult, TypeDesc, TypeVarId,
33};
34
35#[cfg(test)]
36mod tests {
37    #[test]
38    fn manifest_stays_free_of_fret_ui_renderer_and_platform_dependencies() {
39        let manifest = include_str!("../Cargo.toml");
40        for forbidden in [
41            "fret-core",
42            "fret-ui",
43            "fret-runtime",
44            "fret-canvas",
45            "wgpu",
46            "winit",
47        ] {
48            assert!(
49                !manifest.contains(forbidden),
50                "jellyflow-core must stay headless; forbidden dependency `{forbidden}` found",
51            );
52        }
53    }
54}