pub fn build_with_scheduler<F, S>(constructor: F) -> Result<Self, SchedulerError>
    where
        F: FnOnce(&mut Circuit<()>),
        S: Scheduler + 'static,
    {
        let mut circuit = Circuit::new();
        constructor(&mut circuit);
        let executor = Box::new(<OnceExecutor<S>>::new(&circuit)?) as Box<dyn Executor<()>>;

        // Alternatively, `Root` should expose `clock_start` and `clock_end` APIs, so
        // that the user can reset the circuit at runtime and start evaluation
        // from clean state without having to rebuild it from scratch.
        circuit.log_scheduler_event(&SchedulerEvent::clock_start());
        circuit.clock_start(0);
        Ok(Self { circuit, executor })
    }
/// Create a circuit and prepate it for execution.
///
/// Similar to [`build`](`Self::build`), but with a user-specified
/// [`Scheduler`] implementation.
Create a circuit and prepate it for execution.
Create a circuit and prepate it for execution .
pub fn build_with_scheduler<F, S>(constructor: F) -> Result<Self, SchedulerError>
    where
        F: FnOnce(&mut Circuit<()>),
        S: Scheduler + 'static,
    {
        let mut circuit = Circuit::new();
        constructor(&mut circuit);
        let executor = Box::new(<OnceExecutor<S>>::new(&circuit)?) as Box<dyn Executor<()>>;
        // Alternatively, `Root` should expose `clock_start` and `clock_end` APIs, so
        // that the user can reset the circuit at runtime and start evaluation
        // from clean state without having to rebuild it from scratch.
        circuit.log_scheduler_event(&SchedulerEvent::clock_start());
        circuit.clock_start(0);
        Ok(Self { circuit, executor })
    }
pub fn build_with_scheduler < F , S > ( constructor : F ) -> Result < Self , SchedulerError > where F : FnOnce ( & mut Circuit < ( ) > ) , S : Scheduler + ' static , { let mut circuit = Circuit :: new ( ) ; constructor ( & mut circuit ) ; let executor = Box :: new ( < OnceExecutor < S > > :: new ( & circuit ) ? ) as Box < dyn Executor < ( ) > > ; // Alternatively, `Root` should expose `clock_start` and `clock_end` APIs, so // that the user can reset the circuit at runtime and start evaluation // from clean state without having to rebuild it from scratch. circuit . log_scheduler_event ( & SchedulerEvent :: clock_start ( ) ) ; circuit . clock_start ( 0 ) ; Ok ( Self { circuit , executor } ) }
Create a circuit and prepate it for execution.
Create a circuit and prepate it for execution .
constructor
F