#json #lua #api-bindings

mlua-json

A Rust-native implementation of lua-periphery for mlua

3 releases (1 stable)

1.0.0 Oct 29, 2024
0.1.1 Oct 19, 2024
0.1.0 Aug 11, 2024

#1166 in Encoding

Download history 93/week @ 2024-08-05 266/week @ 2024-08-12 169/week @ 2024-08-19 205/week @ 2024-08-26 113/week @ 2024-09-02 82/week @ 2024-09-09 38/week @ 2024-09-16 15/week @ 2024-09-23 19/week @ 2024-09-30 401/week @ 2024-10-07 153/week @ 2024-10-14 103/week @ 2024-10-21 132/week @ 2024-10-28 6/week @ 2024-11-04 14/week @ 2024-11-11

294 downloads per month

MIT license

11KB
235 lines

mlua-json

Rust-native JSON support for mlua.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-json --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_json::preload(&lua);
let script = r#"
    local json = require('json')
    local table = json.decode('{"abc":123,"def":true}')
    local s = json.encode(table)
"#;

Testing

$ make check

Dependencies

~2.4–9MB
~81K SLoC