rquickjs 0.12.0

High level bindings to the QuickJS JavaScript engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
error[E0597]: `var` does not live long enough
  --> tests/async_compile_fail/captured_variable_spawn.rs:8:19
   |
 7 |       let mut var = 1u32;
   |           ------- binding `var` declared here
 8 |       let var_ref = &mut var;
   |                     ^^^^^^^^ borrowed value does not live long enough
 9 |       ctx.async_with(async |ctx| {
   |  ________________________________-
10 | |         let func = Func::from(MutFn::from(move || {
11 | |             *var_ref += 1;
12 | |         }));
13 | |         ctx.globals().set("t", func).unwrap();
14 | |     })
   | |_____- returning this value requires that `var` is borrowed for `'static`
15 |       .await
16 |   }
   |   - `var` dropped here while still borrowed