Crates.io | mlua-json |
lib.rs | mlua-json |
version | 1.0.1 |
created_at | 2024-08-11 15:42:06.577761+00 |
updated_at | 2025-08-01 00:46:53.086936+00 |
description | A Rust-native implementation of LuaRocks openresty/lua-cjson or grafi/lunajson for mlua. |
homepage | https://on-prem.net |
repository | https://gitlab.com/megalithic-llc/mlua-json.git |
max_upload_size | |
id | 1333419 |
size | 4,152,935 |
Rust-native JSON support for mlua.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-json --features luajit
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)
"#;
$ make check