Crates.io | mlua-socket |
lib.rs | mlua-socket |
version | 0.1.8 |
source | src |
created_at | 2023-10-07 11:36:09.545004 |
updated_at | 2024-05-11 16:55:32.180483 |
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 | 131,847 |
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()?;