pub trait GraphExt {
// Required methods
fn add_subgraph_sink<Name, F, R>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R>),
R: 'static + Handoff;
fn add_subgraph_2sink<Name, F, R1, R2>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R1>, &RecvCtx<R2>),
R1: 'static + Handoff,
R2: 'static + Handoff;
fn add_subgraph_source<Name, F, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &SendCtx<W>),
W: 'static + Handoff;
fn add_subgraph_in_out<Name, F, R, W>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R>, &SendCtx<W>),
R: 'static + Handoff,
W: 'static + Handoff;
fn add_subgraph_in_2out<Name, F, R, W1, W2>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
send_port_1: SendPort<W1>,
send_port_2: SendPort<W2>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R>, &SendCtx<W1>, &SendCtx<W2>),
R: 'static + Handoff,
W1: 'static + Handoff,
W2: 'static + Handoff;
fn add_subgraph_2in_out<Name, F, R1, R2, W>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R1>, &RecvCtx<R2>, &SendCtx<W>),
R1: 'static + Handoff,
R2: 'static + Handoff,
W: 'static + Handoff;
fn add_subgraph_2in_2out<Name, F, R1, R2, W1, W2>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
send_port_1: SendPort<W1>,
send_port_2: SendPort<W2>,
subgraph: F,
) -> SubgraphId
where Name: Into<Cow<'static, str>>,
F: 'static + FnMut(&Context, &RecvCtx<R1>, &RecvCtx<R2>, &SendCtx<W1>, &SendCtx<W2>),
R1: 'static + Handoff,
R2: 'static + Handoff,
W1: 'static + Handoff,
W2: 'static + Handoff;
fn add_channel_input<Name, T, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
) -> Input<T, SyncSender<T>>
where Name: Into<Cow<'static, str>>,
T: 'static,
W: 'static + Handoff + CanReceive<T>;
fn add_input<Name, T, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
) -> Input<T, Buffer<T>>
where Name: Into<Cow<'static, str>>,
T: 'static,
W: 'static + Handoff + CanReceive<T>;
fn add_input_from_stream<Name, T, W, S>(
&mut self,
name: Name,
send_port: SendPort<W>,
stream: S,
)
where Name: Into<Cow<'static, str>>,
S: 'static + Stream<Item = T>,
W: 'static + Handoff + CanReceive<T>;
}
Expand description
Convenience extension methods for the Hydroflow struct.
Required Methods§
sourcefn add_subgraph_sink<Name, F, R>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_sink<Name, F, R>( &mut self, name: Name, recv_port: RecvPort<R>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R,
- Outputs:
sourcefn add_subgraph_2sink<Name, F, R1, R2>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_2sink<Name, F, R1, R2>( &mut self, name: Name, recv_port_1: RecvPort<R1>, recv_port_2: RecvPort<R2>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R1, R2,
- Outputs:
sourcefn add_subgraph_source<Name, F, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_source<Name, F, W>( &mut self, name: Name, send_port: SendPort<W>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs:
- Outputs: W,
sourcefn add_subgraph_in_out<Name, F, R, W>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_in_out<Name, F, R, W>( &mut self, name: Name, recv_port: RecvPort<R>, send_port: SendPort<W>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R,
- Outputs: W,
sourcefn add_subgraph_in_2out<Name, F, R, W1, W2>(
&mut self,
name: Name,
recv_port: RecvPort<R>,
send_port_1: SendPort<W1>,
send_port_2: SendPort<W2>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_in_2out<Name, F, R, W1, W2>( &mut self, name: Name, recv_port: RecvPort<R>, send_port_1: SendPort<W1>, send_port_2: SendPort<W2>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R,
- Outputs: W1, W2,
sourcefn add_subgraph_2in_out<Name, F, R1, R2, W>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
send_port: SendPort<W>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_2in_out<Name, F, R1, R2, W>( &mut self, name: Name, recv_port_1: RecvPort<R1>, recv_port_2: RecvPort<R2>, send_port: SendPort<W>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R1, R2,
- Outputs: W,
sourcefn add_subgraph_2in_2out<Name, F, R1, R2, W1, W2>(
&mut self,
name: Name,
recv_port_1: RecvPort<R1>,
recv_port_2: RecvPort<R2>,
send_port_1: SendPort<W1>,
send_port_2: SendPort<W2>,
subgraph: F,
) -> SubgraphId
fn add_subgraph_2in_2out<Name, F, R1, R2, W1, W2>( &mut self, name: Name, recv_port_1: RecvPort<R1>, recv_port_2: RecvPort<R2>, send_port_1: SendPort<W1>, send_port_2: SendPort<W2>, subgraph: F, ) -> SubgraphId
Adds a subgraph with specific topology:
- Inputs: R1, R2,
- Outputs: W1, W2,
sourcefn add_channel_input<Name, T, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
) -> Input<T, SyncSender<T>>
fn add_channel_input<Name, T, W>( &mut self, name: Name, send_port: SendPort<W>, ) -> Input<T, SyncSender<T>>
Adds a channel input which sends to the send_port
.
sourcefn add_input<Name, T, W>(
&mut self,
name: Name,
send_port: SendPort<W>,
) -> Input<T, Buffer<T>>
fn add_input<Name, T, W>( &mut self, name: Name, send_port: SendPort<W>, ) -> Input<T, Buffer<T>>
Adds an “input” operator, returning a handle to insert data into it. TODO(justin): make this thing work better
sourcefn add_input_from_stream<Name, T, W, S>(
&mut self,
name: Name,
send_port: SendPort<W>,
stream: S,
)where
Name: Into<Cow<'static, str>>,
S: 'static + Stream<Item = T>,
W: 'static + Handoff + CanReceive<T>,
fn add_input_from_stream<Name, T, W, S>(
&mut self,
name: Name,
send_port: SendPort<W>,
stream: S,
)where
Name: Into<Cow<'static, str>>,
S: 'static + Stream<Item = T>,
W: 'static + Handoff + CanReceive<T>,
Adds a subgraph which pulls from the async stream and sends to the send_port
.
Object Safety§
This trait is not object safe.