9 releases

new 0.1.8 May 11, 2024
0.1.7 Mar 2, 2024
0.1.6 Feb 11, 2024
0.1.5 Dec 24, 2023
0.1.1 Oct 29, 2023

#456 in Network programming

Download history 148/week @ 2024-01-29 35/week @ 2024-02-12 8/week @ 2024-02-19 158/week @ 2024-02-26 29/week @ 2024-03-04 88/week @ 2024-03-11 60/week @ 2024-03-18 18/week @ 2024-03-25 62/week @ 2024-04-01 104/week @ 2024-04-08 13/week @ 2024-04-22 8/week @ 2024-04-29 214/week @ 2024-05-06

268 downloads per month

MIT license

125KB
3K SLoC

Rust 2K SLoC // 0.0% comments Lua 1K SLoC // 0.2% comments

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()?;

Dependencies

~2–30MB
~431K SLoC