hydro_test_local/local/
first_ten.rs
1use hydro_lang::deploy::SingleProcessGraph;
2use hydro_lang::dfir_rs::scheduled::graph::Dfir;
3use hydro_lang::*;
4use stageleft::Quoted;
5
6pub fn first_ten(flow: &FlowBuilder) {
7 let process = flow.process::<()>();
8 let numbers = process.source_iter(q!(0..10));
9 numbers.for_each(q!(|n| println!("{}", n)));
10}
11
12#[stageleft::entry]
13pub fn first_ten_runtime<'a>(flow: FlowBuilder<'a>) -> impl Quoted<'a, Dfir<'a>> {
14 first_ten(&flow);
15 flow.compile_no_network::<SingleProcessGraph>()
16}
17
18#[cfg(stageleft_runtime)]
19#[cfg(test)]
20mod tests {
21 #[test]
22 fn instantiate_first_ten() {
23 let _ = super::first_ten_runtime!();
24 }
25}