8 releases

0.1.7 Mar 2, 2024
0.1.6 Feb 11, 2024
0.1.5 Dec 24, 2023
0.1.2 Nov 19, 2023
0.1.1 Oct 29, 2023

#464 in Network programming

Download history 22/week @ 2023-12-21 17/week @ 2024-01-11 22/week @ 2024-01-18 89/week @ 2024-01-25 59/week @ 2024-02-01 17/week @ 2024-02-08 21/week @ 2024-02-15 17/week @ 2024-02-22 160/week @ 2024-02-29 28/week @ 2024-03-07 87/week @ 2024-03-14 55/week @ 2024-03-21 32/week @ 2024-03-28 64/week @ 2024-04-04

242 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–12MB
~105K SLoC