#sockets #transpiled #version #udp-socket #wasm #box #e-net

no-std rusty_enet

ENet for Rust (and wasm!) transpiled from C

2 unstable releases

0.2.0 May 18, 2024
0.1.0 May 14, 2024

#1138 in Network programming

Download history 276/week @ 2024-05-12 64/week @ 2024-05-19 3/week @ 2024-05-26

343 downloads per month

MIT license

375KB
7.5K SLoC

rusty_enet

ENet transpiled to Rust, and made agnostic to the underlying socket. Supports std::net::UdpSocket out of the box. Works in WASM if you bring your own WebRTC interface or similar.

[dependencies]
rusty_enet = "0.2"

ENet Versions

rusty_enet ENet Commit
main 1.3.18 (enet/2662c0d)
0.2 1.3.18 (enet/2662c0d)
0.1 1.3.17* (enet/2a85cd6)

* indicates non-exact version (see commit)

Why?

From ENet's website:

ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol). The primary feature it provides is optional reliable, in-order delivery of packets.

ENet omits certain higher level networking features such as authentication, lobbying, server discovery, encryption, or other similar tasks that are particularly application specific so that the library remains flexible, portable, and easily embeddable.

This Rust port allows using ENet with more than just UDP sockets. Most noteably, in WASM environments.

Project Status

The entire API has been wrapped in safe Rust bindings, and I've tested things pretty thoroughly in my own projects. Despite the low semver version, this project couldn't be much further from "ready for serious use".

There may have been some bugs introduced during the C -> Rust transpilation and cleanup, but I've been diligent to keep changes to the original code minimal, and double check those that were necessary.

Dependencies

~0–275KB