13 releases

0.2.2 Oct 29, 2024
0.2.0 Aug 31, 2024
0.1.8 May 11, 2024
0.1.7 Mar 2, 2024
0.1.2 Nov 19, 2023

#418 in Network programming

Download history 32/week @ 2024-07-29 120/week @ 2024-08-05 317/week @ 2024-08-12 173/week @ 2024-08-19 403/week @ 2024-08-26 134/week @ 2024-09-02 79/week @ 2024-09-09 57/week @ 2024-09-16 19/week @ 2024-09-23 29/week @ 2024-09-30 407/week @ 2024-10-07 160/week @ 2024-10-14 104/week @ 2024-10-21 133/week @ 2024-10-28 8/week @ 2024-11-04 13/week @ 2024-11-11

322 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

~6–37MB
~595K SLoC