dfir_rs/
lib.rs

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