MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / with_blocking

Method with_blocking

crates/wasmtime/src/runtime/fiber.rs:351–356  ·  view source on GitHub ↗

Creates a `BlockingContext` suitable for blocking on futures or suspending the current fiber. # Panics Panics if this is invoked outside the context of a fiber.

(
        self,
        f: impl FnOnce(StoreContextMut<'_, T>, &mut BlockingContext<'_, '_>) -> R,
    )

Source from the content-addressed store, hash-verified

349 ///
350 /// Panics if this is invoked outside the context of a fiber.
351 pub(crate) fn with_blocking<R>(
352 self,
353 f: impl FnOnce(StoreContextMut<'_, T>, &mut BlockingContext<'_, '_>) -> R,
354 ) -> R {
355 BlockingContext::with(self.0, |store, cx| f(StoreContextMut(store), cx))
356 }
357}
358
359impl StoreOpaque {

Callers 6

block_onMethod · 0.80
vmctx_asyncMethod · 0.80
invoke_call_hookMethod · 0.80
suspendMethod · 0.80
func_new_asyncMethod · 0.80

Calls 3

withFunction · 0.85
StoreContextMutClass · 0.85
fFunction · 0.50

Tested by

no test coverage detected