hydro_lang/sim/
mod.rs

1//! Deterministic simulation testing support for Hydro programs.
2//!
3//! See [`crate::compile::builder::FlowBuilder::sim`] and [`flow::SimFlow`] for more details.
4
5use std::marker::PhantomData;
6
7use serde::Serialize;
8use serde::de::DeserializeOwned;
9
10use crate::compile::builder::ExternalPortId;
11use crate::live_collections::stream::{Ordering, Retries};
12
13/// A receiver for an external bincode stream in a simulation.
14pub struct SimReceiver<T: Serialize + DeserializeOwned, O: Ordering, R: Retries>(
15    pub(crate) ExternalPortId,
16    pub(crate) PhantomData<(T, O, R)>,
17);
18
19/// A sender to an external bincode sink in a simulation.
20pub struct SimSender<T: Serialize + DeserializeOwned, O: Ordering, R: Retries>(
21    pub(crate) ExternalPortId,
22    pub(crate) PhantomData<(T, O, R)>,
23);
24
25#[cfg(stageleft_runtime)]
26mod builder;
27
28#[cfg(stageleft_runtime)]
29pub mod compiled;
30
31#[cfg(stageleft_runtime)]
32pub(crate) mod graph;
33
34#[cfg(stageleft_runtime)]
35pub mod flow;
36
37#[cfg(stageleft_runtime)]
38#[doc(hidden)]
39pub mod runtime;
40
41#[cfg(test)]
42mod tests;