Skip to main content

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::context::Dfir) struct,
7//! representing a DFIR dataflow instance. Instantiate one with the
8//! [`dfir_syntax!`] macro using 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
23pub use ::{
24    bincode, bytes, dfir_pipes, futures, lattices, pin_project_lite, rustc_hash, serde, serde_json,
25    sinktools, tokio, tokio_stream, tokio_util, tracing, web_time,
26};
27#[cfg(feature = "meta")]
28#[cfg_attr(docsrs, doc(cfg(feature = "meta")))]
29pub use dfir_lang as lang;
30pub use dfir_lang;
31pub use dfir_pipes::itertools;
32pub use slotmap;
33pub use variadics::{self, var_args, var_expr, var_type};
34
35/// `#[macro_use]` automagically brings the declarative macro export to the crate-level.
36mod declarative_macro;
37#[cfg_attr(docsrs, doc(cfg(feature = "dfir_macro")))]
38#[cfg(feature = "dfir_macro")]
39pub use dfir_macro::{
40    DemuxEnum, dfir_main as main, dfir_parser, dfir_syntax, dfir_syntax_noemit, dfir_test as test,
41    monotonic_fn, morphism,
42};
43pub use futures::never::Never;
44
45#[cfg(doctest)]
46mod booktest {
47    mod surface_ops {
48        include_mdtests::include_mdtests!("docs/docgen/*.md");
49    }
50}