pub(crate) fn try_build(self) -> anyhow::Result<ComponentHarness<REv>> {
        let tmp = match self.tmp {
            Some(tmp) => tmp,
            None => {
                TempDir::new().context("could not create temporary directory for test harness")?
            }
        };

        let rng = self.rng.unwrap_or_else(TestRng::new);

        let scheduler = Box::leak(Box::new(Scheduler::new(QueueKind::weights())));
        let event_queue_handle = EventQueueHandle::without_shutdown(scheduler);
        let effect_builder = EffectBuilder::new(event_queue_handle);
        let runtime = runtime::Builder::new_multi_thread()
            .enable_all()
            .build()
            .context("build tokio runtime")?;

        Ok(ComponentHarness {
            rng,
            scheduler,
            effect_builder,
            tmp,
            runtime,
        })
    }
/// Tries to build a component harness.
///
/// Construction may fail for various reasons such as not being able to create a temporary
/// directory.
Tries to build a component harness.
Construction may fail for various reasons such as not being able to create a temporary
directory.
Tries to build a component harness . Construction may fail for various reasons such as not being able to create a temporary directory .
pub(crate) fn try_build(self) -> anyhow::Result<ComponentHarness<REv>> {
        let tmp = match self.tmp {
            Some(tmp) => tmp,
            None => {
                TempDir::new().context("could not create temporary directory for test harness")?
            }
        };
        let rng = self.rng.unwrap_or_else(TestRng::new);
        let scheduler = Box::leak(Box::new(Scheduler::new(QueueKind::weights())));
        let event_queue_handle = EventQueueHandle::without_shutdown(scheduler);
        let effect_builder = EffectBuilder::new(event_queue_handle);
        let runtime = runtime::Builder::new_multi_thread()
            .enable_all()
            .build()
            .context("build tokio runtime")?;
        Ok(ComponentHarness {
            rng,
            scheduler,
            effect_builder,
            tmp,
            runtime,
        })
    }
pub ( crate ) fn try_build ( self ) -> anyhow :: Result < ComponentHarness < REv > > { let tmp = match self . tmp { Some ( tmp ) => tmp , None => { TempDir :: new ( ) . context ( " " ) ? } } ; let rng = self . rng . unwrap_or_else ( TestRng :: new ) ; let scheduler = Box :: leak ( Box :: new ( Scheduler :: new ( QueueKind :: weights ( ) ) ) ) ; let event_queue_handle = EventQueueHandle :: without_shutdown ( scheduler ) ; let effect_builder = EffectBuilder :: new ( event_queue_handle ) ; let runtime = runtime :: Builder :: new_multi_thread ( ) . enable_all ( ) . build ( ) . context ( " " ) ? ; Ok ( ComponentHarness { rng , scheduler , effect_builder , tmp , runtime , } ) }
Tries to build a component harness.
Tries to build a component harness .
self
self