pub enum HydroNode {
Show 38 variants
Placeholder,
Cast {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ObserveNonDet {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Source {
source: HydroSource,
metadata: HydroIrMetadata,
},
CycleSource {
ident: Ident,
metadata: HydroIrMetadata,
},
Tee {
inner: TeeNode,
metadata: HydroIrMetadata,
},
Persist {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
BeginAtomic {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
EndAtomic {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Batch {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
YieldConcat {
inner: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Chain {
first: Box<HydroNode>,
second: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ChainFirst {
first: Box<HydroNode>,
second: Box<HydroNode>,
metadata: HydroIrMetadata,
},
CrossProduct {
left: Box<HydroNode>,
right: Box<HydroNode>,
metadata: HydroIrMetadata,
},
CrossSingleton {
left: Box<HydroNode>,
right: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Join {
left: Box<HydroNode>,
right: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Difference {
pos: Box<HydroNode>,
neg: Box<HydroNode>,
metadata: HydroIrMetadata,
},
AntiJoin {
pos: Box<HydroNode>,
neg: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ResolveFutures {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ResolveFuturesOrdered {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Map {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
FlatMap {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Filter {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
FilterMap {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
DeferTick {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Enumerate {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Inspect {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Unique {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Sort {
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Fold {
init: DebugExpr,
acc: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Scan {
init: DebugExpr,
acc: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
FoldKeyed {
init: DebugExpr,
acc: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Reduce {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ReduceKeyed {
f: DebugExpr,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ReduceKeyedWatermark {
f: DebugExpr,
input: Box<HydroNode>,
watermark: Box<HydroNode>,
metadata: HydroIrMetadata,
},
Network {
serialize_fn: Option<DebugExpr>,
instantiate_fn: DebugInstantiate,
deserialize_fn: Option<DebugExpr>,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
ExternalInput {
from_external_id: usize,
from_key: usize,
from_many: bool,
codec_type: DebugType,
port_hint: NetworkHint,
instantiate_fn: DebugInstantiate,
deserialize_fn: Option<DebugExpr>,
metadata: HydroIrMetadata,
},
Counter {
tag: String,
duration: DebugExpr,
prefix: String,
input: Box<HydroNode>,
metadata: HydroIrMetadata,
},
}
Expand description
An intermediate node in a Hydro graph, which consumes data from upstream nodes and emits data to downstream nodes.
Variants§
Placeholder
Cast
Manually “casts” between two different collection kinds.
Using this IR node requires special care, since it bypasses many of Hydro’s core
correctness checks. In particular, the user must ensure that every possible
“interpretation” of the input corresponds to a distinct “interpretation” of the output,
where an “interpretation” is a possible output of ObserveNonDet
applied to the
collection. This ensures that the simulator does not miss any possible outputs.
ObserveNonDet
Strengthens the guarantees of a stream by non-deterministically selecting a possible interpretation of the input stream.
In production, this simply passes through the input, but in simulation, this operator explicitly selects a randomized interpretation.
Source
CycleSource
Tee
Persist
BeginAtomic
EndAtomic
Batch
YieldConcat
Chain
ChainFirst
CrossProduct
CrossSingleton
Join
Difference
AntiJoin
ResolveFutures
ResolveFuturesOrdered
Map
FlatMap
Filter
FilterMap
DeferTick
Enumerate
Inspect
Unique
Sort
Fold
Scan
FoldKeyed
Reduce
ReduceKeyed
ReduceKeyedWatermark
Network
ExternalInput
Counter
Implementations§
Source§impl HydroNode
impl HydroNode
pub fn transform_bottom_up( &mut self, transform: &mut impl FnMut(&mut HydroNode), seen_tees: &mut SeenTees, check_well_formed: bool, )
pub fn transform_children( &mut self, transform: impl FnMut(&mut HydroNode, &mut SeenTees), seen_tees: &mut SeenTees, )
pub fn deep_clone(&self, seen_tees: &mut SeenTees) -> HydroNode
pub fn emit_core( &mut self, builders_or_callback: &mut BuildersOrCallback<'_, impl FnMut(&mut HydroRoot, &mut usize), impl FnMut(&mut HydroNode, &mut usize)>, built_tees: &mut HashMap<*const RefCell<HydroNode>, Ident>, next_stmt_id: &mut usize, ) -> Ident
build
only.pub fn visit_debug_expr(&mut self, transform: impl FnMut(&mut DebugExpr))
pub fn op_metadata(&self) -> &HydroIrOpMetadata
pub fn metadata(&self) -> &HydroIrMetadata
pub fn op_metadata_mut(&mut self) -> &mut HydroIrOpMetadata
pub fn metadata_mut(&mut self) -> &mut HydroIrMetadata
pub fn input_metadata(&self) -> Vec<&HydroIrMetadata>
pub fn print_root(&self) -> String
Source§impl HydroNode
impl HydroNode
Sourcepub fn build_graph_structure(
&self,
structure: &mut HydroGraphStructure,
seen_tees: &mut HashMap<*const RefCell<HydroNode>, usize>,
config: &HydroWriteConfig,
) -> usize
Available on crate feature viz
only.
pub fn build_graph_structure( &self, structure: &mut HydroGraphStructure, seen_tees: &mut HashMap<*const RefCell<HydroNode>, usize>, config: &HydroWriteConfig, ) -> usize
viz
only.Build the graph structure recursively for this node.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HydroNode
impl !RefUnwindSafe for HydroNode
impl !Send for HydroNode
impl !Sync for HydroNode
impl Unpin for HydroNode
impl !UnwindSafe for HydroNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more