flowlog_runtime/lib.rs
1//! FlowLog runtime — types and re-exports consumed by generated code.
2//!
3//! This crate is the runtime half of the FlowLog library-mode toolchain.
4//! Pair it with [`flowlog-build`] in your `[build-dependencies]`:
5//!
6//! ```toml
7//! [dependencies]
8//! flowlog-runtime = "0.1"
9//!
10//! [build-dependencies]
11//! flowlog-build = "0.1"
12//! ```
13//!
14//! ## What's in this crate
15//!
16//! | Module | Purpose |
17//! |--------|---------|
18//! | [`Relation`] | Trait implemented by every generated input struct |
19//! | [`io`] | Byte-range file reader + first-column sharding for parallel ingestion |
20//! | [`intern`] | Thread-safe string interning pool (`lasso`) |
21//!
22//! The re-exported crates (`timely`, `differential_dataflow`, etc.) are
23//! used internally by the generated code — you should not need to
24//! reference them directly.
25
26pub mod intern;
27pub mod io;
28pub mod sort;
29
30/// Trait implemented by every generated input relation struct.
31///
32/// The generated `DatalogBatchEngine` calls [`Relation::to_tuple`] at
33/// insert time to convert user-facing structs (e.g. `Edge { x: 1, y: 2 }`)
34/// into the internal differential-dataflow tuple representation.
35///
36/// You don't implement this trait manually — `flowlog-build` generates an
37/// impl for each `.input` relation declared in your `.dl` program.
38pub trait Relation: Sized {
39 /// The internal DD tuple type (e.g. `(i32, i32)`).
40 type Tuple;
41 /// Relation name (lowercase), matching the DD input session key.
42 fn relation_name() -> &'static str;
43 /// Convert self into the internal tuple layout.
44 fn to_tuple(self) -> Self::Tuple;
45}
46
47// Re-exports for generated code. The `include!()`'d code references these
48// via `::flowlog_runtime::timely::*`, `::flowlog_runtime::differential_dataflow::*`,
49// etc. Users should not need to use them directly.
50#[doc(hidden)]
51pub use differential_dataflow;
52#[doc(hidden)]
53pub use lasso;
54#[doc(hidden)]
55pub use ordered_float;
56#[doc(hidden)]
57pub use serde;
58#[doc(hidden)]
59pub use timely;