#xid #mlua #lua #api-bindings

mlua-xid

A Rust-native binding for the 'xid' crate for Rust

1 unstable release

0.1.0 Sep 21, 2025

#635 in Programming languages

Download history 173/week @ 2025-09-20 175/week @ 2025-09-27

348 downloads per month

MIT license

305KB
55 lines

mlua-xid

Rust-native XID 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-xid --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_xid::preload(&lua).unwrap();

let script = r#"
    local xid = require('xid)
    local id = xid.new()
    return tostring(id)
"#;
let s: String = lua.load(script).eval().unwrap();
assert_eq!(s.len(), 20);

Testing

$ make check

Dependencies

~2.6–7MB
~128K SLoC