pub(crate) fn subcircuit<F, T, E>(
        &self,
        iterative: bool,
        child_constructor: F,
    ) -> Result<T, SchedulerError>
    where
        F: FnOnce(&mut Circuit<Self>) -> Result<(T, E), SchedulerError>,
        E: Executor<Self>,
    {
        self.try_add_node(|id| {
            let global_id = GlobalNodeId::child_of(self, id);
            self.log_circuit_event(&CircuitEvent::subcircuit(global_id.clone(), iterative));
            let mut child_circuit = Circuit::with_parent(self.clone(), id);
            let (res, executor) = child_constructor(&mut child_circuit)?;
            let child = <ChildNode<Self>>::new::<E>(child_circuit, executor);
            self.log_circuit_event(&CircuitEvent::subcircuit_complete(global_id));
            Ok((child, res))
        })
    }
/// Add a child circuit.
///
/// Creates an empty circuit with `self` as parent and invokes
/// `child_constructor` to populate the circuit.  `child_constructor`
/// typically captures some of the streams in `self` and connects them
/// to source nodes of the child circuit.  It is also responsible for
/// attaching an executor to the child circuit.  The return type `T`
/// will typically contain output streams of the child.
///
/// Most users should invoke higher-level APIs like [`iterate`] instead of
/// using this method directly.
Add a child circuit.
Creates an empty circuit with `self` as parent and invokes
`child_constructor` to populate the circuit.  `child_constructor`
typically captures some of the streams in `self` and connects them
to source nodes of the child circuit.  It is also responsible for
attaching an executor to the child circuit.  The return type `T`
will typically contain output streams of the child.

Most users should invoke higher-level APIs like [`iterate`] instead of
using this method directly.
Add a child circuit . Creates an empty circuit with ` self ` as parent and invokes ` child_constructor ` to populate the circuit . ` child_constructor ` typically captures some of the streams in ` self ` and connects them to source nodes of the child circuit . It is also responsible for attaching an executor to the child circuit . The return type ` T ` will typically contain output streams of the child . Most users should invoke higher - level APIs like [ ` iterate ` ] instead of using this method directly .
pub(crate) fn subcircuit<F, T, E>(
        &self,
        iterative: bool,
        child_constructor: F,
    ) -> Result<T, SchedulerError>
    where
        F: FnOnce(&mut Circuit<Self>) -> Result<(T, E), SchedulerError>,
        E: Executor<Self>,
    {
        self.try_add_node(|id| {
            let global_id = GlobalNodeId::child_of(self, id);
            self.log_circuit_event(&CircuitEvent::subcircuit(global_id.clone(), iterative));
            let mut child_circuit = Circuit::with_parent(self.clone(), id);
            let (res, executor) = child_constructor(&mut child_circuit)?;
            let child = <ChildNode<Self>>::new::<E>(child_circuit, executor);
            self.log_circuit_event(&CircuitEvent::subcircuit_complete(global_id));
            Ok((child, res))
        })
    }
pub ( crate ) fn subcircuit < F , T , E > ( & self , iterative : bool , child_constructor : F , ) -> Result < T , SchedulerError > where F : FnOnce ( & mut Circuit < Self > ) -> Result < ( T , E ) , SchedulerError > , E : Executor < Self > , { self . try_add_node ( | id | { let global_id = GlobalNodeId :: child_of ( self , id ) ; self . log_circuit_event ( & CircuitEvent :: subcircuit ( global_id . clone ( ) , iterative ) ) ; let mut child_circuit = Circuit :: with_parent ( self . clone ( ) , id ) ; let ( res , executor ) = child_constructor ( & mut child_circuit ) ? ; let child = < ChildNode < Self > > :: new :: < E > ( child_circuit , executor ) ; self . log_circuit_event ( & CircuitEvent :: subcircuit_complete ( global_id ) ) ; Ok ( ( child , res ) ) } ) }
Add a child circuit.
Add a child circuit .
&self
iterative
bool
child_constructor
F