Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jabuwu committed May 14, 2024
1 parent c568adc commit 4767040
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 0.1.0
- Initial release
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
name = "rusty_enet"
version = "0.1.0"
edition = "2021"
description = "ENet for Rust (and wasm!) transpiled from C."
homepage = "https://github.com/jabuwu/rusty_net"
repository = "https://github.com/jabuwu/rusty_net"
readme = "README.md"
license = "MIT"
exclude = [
"/.github",
"/ci",
"/examples",
]

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.69"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

[ENet](https://github.com/lsalzman/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.1"
```

## Why?

From [ENet's website](http://sauerbraten.org/enet/):
Expand All @@ -11,3 +16,9 @@ From [ENet's website](http://sauerbraten.org/enet/):
> 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.
10 changes: 5 additions & 5 deletions ci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ bitflags! {
}

fn main() -> anyhow::Result<()> {
std::env::set_var("RUSTFLAGS", "-D warnings");

let arguments = [
("check", Check::CHECK),
("wasm-check", Check::WASM_CHECK),
Expand Down Expand Up @@ -79,12 +77,14 @@ fn main() -> anyhow::Result<()> {

fn check(sh: &Shell, target: Target) -> anyhow::Result<()> {
let target_flags = &target.flags();
cmd!(sh, "cargo check {target_flags...}").run()?;
cmd!(sh, "cargo rustc {target_flags...} -- -D warnings").run()?;
Ok(())
}

fn example_check(sh: &Shell) -> anyhow::Result<()> {
cmd!(sh, "cargo check --examples").run()?;
for example in ["client", "read_write", "server"] {
cmd!(sh, "cargo rustc --example {example} -- -D warnings").run()?;
}
Ok(())
}

Expand Down Expand Up @@ -114,6 +114,6 @@ fn doc_check(sh: &Shell) -> anyhow::Result<()> {
}

fn clippy(sh: &Shell) -> anyhow::Result<()> {
cmd!(sh, "cargo clippy --workspace --all-targets").run()?;
cmd!(sh, "cargo clippy --workspace --all-targets -- -D warnings").run()?;
Ok(())
}

0 comments on commit 4767040

Please sign in to comment.