Expand description
Build-script integration for FlowLog library mode.
Compiles a .dl program into a Rust module your crate include!s
from build.rs.
§Minimal
// build.rs
fn main() -> std::io::Result<()> {
flowlog_build::compile("policy.dl")
}ⓘ
// src/lib.rs
pub mod policy { include!(concat!(env!("OUT_DIR"), "/policy.rs")); }
use policy::DatalogBatchEngine;
let mut engine = DatalogBatchEngine::new(4);
engine.insert_edge(vec![(1, 2), (2, 3)]);
let results = engine.run();§Structured errors
Builder::compile returns a [BoxError] for callers that want to
render the diagnostic themselves rather than surface it through
io::Error:
use flowlog_build::Builder;
// build.rs
if let Err(err) = Builder::default()
.sip(true)
.string_intern(true)
.compile(&["policy.dl", "auth.dl"], &[] as &[&std::path::Path])
{
eprintln!("{err}");
std::process::exit(1);
}Structs§
- Builder
- Chained configuration for advanced compilation options. For default
settings prefer the free
compilefunction.
Enums§
- Build
Error - Infrastructure failure raised by the library-mode build flow.
- Execution
Mode - Execution strategy for FlowLog workflows
Functions§
- compile
- Compile a single
.dlprogram with default options.