mlua-socket

Crates.iomlua-socket
lib.rsmlua-socket
version0.2.2
sourcesrc
created_at2023-10-07 11:36:09.545004
updated_at2024-10-29 13:27:28.200054
descriptionA Rust-native implementation of LuaSocket for mlua.
homepagehttps://on-prem.net
repositoryhttps://gitlab.com/megalithic-llc/mlua-socket.git
max_upload_size
id996244
size134,869
David Rauschenbach (drauschenbach)

documentation

README

mlua-socket

A Rust-native implementation of LuaSocket 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-socket --features luajit

Testing

$ make check

Benchmarking

$ make bench

Using

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()?;
Commit count: 96

cargo fmt