Crates.io | mlua-socket |
lib.rs | mlua-socket |
version | 0.2.2 |
source | src |
created_at | 2023-10-07 11:36:09.545004 |
updated_at | 2024-10-29 13:27:28.200054 |
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 | 134,869 |
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()?;