dfir_rs/
lib.rs

1#![warn(missing_docs)]
2
3//! DFIR is a low-level dataflow-based runtime system for the [Hydro Project](https://hydro.run/).
4//!
5//! The primary item in this crate is the [`Dfir`](crate::scheduled::graph::Dfir) struct,
6//! representing a DFIR dataflow graph. Although this graph can be manually constructed, the
7//! easiest way to instantiate a graph instance is with the [`dfir_syntax!`] macro using
8//! DFIR's custom syntax.
9//!
10//! ```rust
11//! let mut df = dfir_rs::dfir_syntax! {
12//!     source_iter(["hello", "world"]) -> for_each(|s| println!("{}", s));
13//! };
14//! df.run_available();
15//! ```
16//!
17//! For more examples, check out the [`examples` folder on Github](https://github.com/hydro-project/hydro/tree/main/dfir_rs/examples).
18
19pub mod compiled;
20pub mod scheduled;
21pub mod util;
22
23#[cfg(feature = "meta")]
24pub use dfir_lang as lang;
25#[cfg(feature = "python")]
26pub use pyo3;
27pub use variadics::{self, var_args, var_expr, var_type};
28pub use {
29    bincode, bytes, futures, itertools, lattices, pusherator, rustc_hash, serde, serde_json, tokio,
30    tokio_stream, tokio_util, tracing, web_time,
31};
32
33/// `#[macro_use]` automagically brings the declarative macro export to the crate-level.
34mod declarative_macro;
35#[cfg(feature = "dfir_datalog")]
36pub use dfir_datalog::*;
37#[cfg(feature = "dfir_macro")]
38pub use dfir_macro::{
39    DemuxEnum, dfir_main as main, dfir_parser, dfir_syntax, dfir_syntax_noemit, dfir_test as test,
40    monotonic_fn, morphism,
41};
42
43// TODO(mingwei): Use the [nightly "never" type `!`](https://doc.rust-lang.org/std/primitive.never.html)
44/// Stand-in for the [nightly "never" type `!`](https://doc.rust-lang.org/std/primitive.never.html)
45pub type Never = std::convert::Infallible;
46
47#[cfg(doctest)]
48mod booktest {
49    mod surface_ops {
50        include_mdtests::include_mdtests!("docs/docgen/*.md");
51    }
52}