Trait GraphExt

Source
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 Dfir struct.

Required Methods§

Source

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,

Adds a subgraph with specific topology:

  • Inputs: R,
  • Outputs:
Source

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,

Adds a subgraph with specific topology:

  • Inputs: R1, R2,
  • Outputs:
Source

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,

Adds a subgraph with specific topology:

  • Inputs:
  • Outputs: W,
Source

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,

Adds a subgraph with specific topology:

  • Inputs: R,
  • Outputs: W,
Source

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,

Adds a subgraph with specific topology:

  • Inputs: R,
  • Outputs: W1, W2,
Source

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,

Adds a subgraph with specific topology:

  • Inputs: R1, R2,
  • Outputs: W,
Source

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,

Adds a subgraph with specific topology:

  • Inputs: R1, R2,
  • Outputs: W1, W2,
Source

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>,

Adds a channel input which sends to the send_port.

Source

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>,

Adds an “input” operator, returning a handle to insert data into it. TODO(justin): make this thing work better

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl GraphExt for Dfir<'_>