MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / with_module_async

Method with_module_async

crates/testing/src/modules.rs:223–237  ·  view source on GitHub ↗
(&self, config: Config, routine: R)

Source from the content-addressed store, hash-verified

221 }
222
223 pub fn with_module_async<O, R, F>(&self, config: Config, routine: R)
224 where
225 R: FnOnce(ModuleHandle) -> F,
226 F: Future<Output = O>,
227 {
228 with_runtime(move |runtime| {
229 runtime.block_on(async {
230 let module = self.load_module(config, None).await;
231 let env = module.env.clone();
232 let db_identity = module.db_identity;
233 let routine_result = AssertUnwindSafe(routine(module)).catch_unwind().await.map(drop);
234 finish_module_test(&env, db_identity, routine_result).await;
235 });
236 });
237 }
238
239 pub fn with_module<F>(&self, config: Config, func: F)
240 where

Calls 6

with_runtimeFunction · 0.85
finish_module_testFunction · 0.85
load_moduleMethod · 0.80
block_onMethod · 0.45
cloneMethod · 0.45
mapMethod · 0.45