Expand description
Optional: typed, LS-friendly graph builder (no proc-macro, no big strings). Strongly typed, Language Server–friendly builder for Limen graphs (no proc-macro input and no stringly-typed DSL).
Use this from your crate’s build.rs to construct a
crate::ast::GraphDef with ordinary Rust types and expressions
(typically authored via syn::parse_quote!). Then pass the finished AST to
expand_ast_to_file(..) to emit the generated graph implementation.
§Example
ⓘ
use limen_codegen::builder::{GraphBuilder, GraphVisibility, Node, Edge};
use limen_core::policy::{AdmissionPolicy, EdgePolicy, OverBudgetAction, QueueCaps};
let edge_policy = EdgePolicy::new(
QueueCaps::new(8, 6, None, None),
AdmissionPolicy::DropNewest,
OverBudgetAction::Drop,
);
let ast = GraphBuilder::new("MyGraph", GraphVisibility::Public)
.node(
Node::new(0)
.ty::<my_crate::Source>()
.in_ports(0)
.out_ports(1)
.in_payload::<()>()
.out_payload::<u32>()
.name(Some("source"))
.ingress_policy(edge_policy),
)
.node(
Node::new(1)
.ty::<my_crate::MapU32>()
.in_ports(1)
.out_ports(1)
.in_payload::<u32>()
.out_payload::<u32>()
.name(Some("map")),
)
.edge(
Edge::new(0)
.ty::<limen_core::edge::spsc_array::StaticRing<8>>()
.payload::<u32>()
.manager_ty::<limen_core::memory::static_manager::StaticMemoryManager<u32, 8>>()
.from(0, 0)
.to(1, 0)
.policy(edge_policy)
.name(Some("source->map")),
)
.concurrent(false)
.finish();
// writer.write("my_graph")?;Structs§
- Edge
- Fluent builder for a single edge declaration.
- Graph
Builder - Builder for a single Limen graph AST (
ast::GraphDef). - Graph
Writer - The result of
GraphBuilder::finish()— owns the AST and can write it to disk. - Node
- Fluent builder for a single node declaration.
Enums§
- Graph
Visibility - Visibility options for generated graph types used by
GraphBuilder::new.