MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / spawn

Function spawn

src/runtime/mod.rs:30–36  ·  view source on GitHub ↗

Spawn a `Future` as a `Task` on the current `Reactor`. Panics if called from outside `block_on`.

(fut: F)

Source from the content-addressed store, hash-verified

28///
29/// Panics if called from outside `block_on`.
30pub fn spawn<F, T>(fut: F) -> Task<T>
31where
32 F: std::future::Future<Output = T> + 'static,
33 T: 'static,
34{
35 Reactor::current().spawn(fut)
36}

Callers 1

mainFunction · 0.85

Calls 1

spawnMethod · 0.80

Tested by

no test coverage detected