Crates.io | mlua-xid |
lib.rs | mlua-xid |
version | 0.1.0 |
created_at | 2025-09-21 22:44:47.300174+00 |
updated_at | 2025-09-21 22:44:47.300174+00 |
description | A Rust-native binding for the 'xid' crate for Rust. |
homepage | https://on-prem.net |
repository | https://gitlab.com/megalithic-llc/mlua-xid.git |
max_upload_size | |
id | 1849270 |
size | 4,888,365 |
Rust-native XID support for mlua.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-xid --features luajit
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);
$ make check