| Crates.io | mlua-socket |
| lib.rs | mlua-socket |
| version | 0.2.5 |
| created_at | 2023-10-07 11:36:09.545004+00 |
| updated_at | 2025-08-08 21:50:02.615302+00 |
| description | A Rust-native implementation of LuaSocket for mlua. |
| homepage | https://on-prem.net |
| repository | https://gitlab.com/megalithic-llc/mlua-socket.git |
| max_upload_size | |
| id | 996244 |
| size | 16,173,304 |
A Rust-native implementation of LuaSocket for mlua.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-socket --features luajit
$ make check
$ make bench
use mlua::Lua;
let lua = Lua::new();
mlua_socket::preload(&lua);
let script = r#"
local socket = require('socket')
local client = socket.connect('127.0.0.1', 3000)
return client:send('abcd')
"#;
let _last_index: u16 = lua.load(script).eval()?;