11 releases

0.2.0 Aug 31, 2024
0.1.9 Aug 15, 2024
0.1.8 May 11, 2024
0.1.7 Mar 2, 2024
0.1.1 Oct 29, 2023

#527 in Network programming

Download history 29/week @ 2024-05-18 42/week @ 2024-05-25 13/week @ 2024-06-01 20/week @ 2024-06-08 25/week @ 2024-06-15 88/week @ 2024-06-22 27/week @ 2024-06-29 127/week @ 2024-07-06 116/week @ 2024-07-13 59/week @ 2024-07-20 193/week @ 2024-07-27 101/week @ 2024-08-03 300/week @ 2024-08-10 169/week @ 2024-08-17 104/week @ 2024-08-24 441/week @ 2024-08-31

1,091 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

~5–36MB
~583K SLoC