Skip to main content

RunBody

Type Alias RunBody 

Source
pub type RunBody<T> = Box<dyn for<'js> FnOnce(Ctx<'js>) -> Pin<Box<dyn Future<Output = Result<T, ScriptError>> + 'js>> + Send>;
Expand description

A body handed to Runtime::run: runs on the VM loop with the context in scope, and answers the run’s value.

The future it returns is !Send (it holds JS values); the runtime drives it only on the VM loop, under the engine lock.

Aliased Type§

pub struct RunBody<T>(/* private fields */);