@@ -40,7 +40,7 @@ use wasmtime_runtime::{Export, InstanceHandle, VMContext, VMFunctionBody};
4040/// # fn main() -> anyhow::Result<()> {
4141/// let store = Store::default();
4242/// let module = Module::new(&store, r#"(module (func (export "foo")))"#)?;
43- /// let instance = Instance::new(&module, &[])?;
43+ /// let instance = Instance::new(&module, &[])?.init_reactor(&[])? ;
4444/// let foo = instance.get_func("foo").expect("export wasn't a function");
4545///
4646/// // Work with `foo` as a `Func` at this point, such as calling it
@@ -90,7 +90,7 @@ use wasmtime_runtime::{Export, InstanceHandle, VMContext, VMFunctionBody};
9090/// i32.add))
9191/// "#,
9292/// )?;
93- /// let instance = Instance::new(&module, &[add.into()])?;
93+ /// let instance = Instance::new(&module, &[add.into()])?.init_reactor(&[])? ;
9494/// let call_add_twice = instance.get_func("call_add_twice").expect("export wasn't a function");
9595/// let call_add_twice = call_add_twice.get0::<i32>()?;
9696///
@@ -131,7 +131,7 @@ use wasmtime_runtime::{Export, InstanceHandle, VMContext, VMFunctionBody};
131131/// (start $start))
132132/// "#,
133133/// )?;
134- /// let instance = Instance::new(&module, &[double.into()])?;
134+ /// let instance = Instance::new(&module, &[double.into()])?.init_reactor(&[])? ;
135135/// // .. work with `instance` if necessary
136136/// # Ok(())
137137/// # }
@@ -344,7 +344,7 @@ impl Func {
344344 /// call $add))
345345 /// "#,
346346 /// )?;
347- /// let instance = Instance::new(&module, &[add.into()])?;
347+ /// let instance = Instance::new(&module, &[add.into()])?.init_reactor(&[])? ;
348348 /// let foo = instance.get_func("foo").unwrap().get2::<i32, i32, i32>()?;
349349 /// assert_eq!(foo(1, 2)?, 3);
350350 /// # Ok(())
@@ -375,7 +375,7 @@ impl Func {
375375 /// call $add))
376376 /// "#,
377377 /// )?;
378- /// let instance = Instance::new(&module, &[add.into()])?;
378+ /// let instance = Instance::new(&module, &[add.into()])?.init_reactor(&[])? ;
379379 /// let foo = instance.get_func("foo").unwrap().get2::<i32, i32, i32>()?;
380380 /// assert_eq!(foo(1, 2)?, 3);
381381 /// assert!(foo(i32::max_value(), 1).is_err());
@@ -408,7 +408,7 @@ impl Func {
408408 /// call $debug))
409409 /// "#,
410410 /// )?;
411- /// let instance = Instance::new(&module, &[debug.into()])?;
411+ /// let instance = Instance::new(&module, &[debug.into()])?.init_reactor(&[])? ;
412412 /// let foo = instance.get_func("foo").unwrap().get0::<()>()?;
413413 /// foo()?;
414414 /// # Ok(())
@@ -464,7 +464,7 @@ impl Func {
464464 /// (data (i32.const 4) "Hello, world!"))
465465 /// "#,
466466 /// )?;
467- /// let instance = Instance::new(&module, &[log_str.into()])?;
467+ /// let instance = Instance::new(&module, &[log_str.into()])?.init_reactor(&[])? ;
468468 /// let foo = instance.get_func("foo").unwrap().get0::<()>()?;
469469 /// foo()?;
470470 /// # Ok(())
0 commit comments