rquickjs 0.11.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
use rquickjs::{async_with, AsyncContext, AsyncRuntime};

pub async fn test() {
    let rt = AsyncRuntime::new().unwrap();
    let ctx_1 = AsyncContext::full(&rt).await.unwrap();
    let ctx_2 = AsyncContext::full(&rt).await.unwrap();
    async_with!(ctx_1 => |ctx_1|{
        async_with!(ctx_2 => |ctx_2|{
            // It is disallowed to use multiple ctx object together from different with closures.
            // Lifetime on ctx should be unique.
            ctx_1.globals().set("t", ctx_2.globals());
        }).await
    })
    .await
}

fn main() {}