64 releases (22 breaking)

0.24.1 Oct 25, 2024
0.23.0 Aug 27, 2024
0.22.1 Jun 14, 2024
0.19.5 Mar 31, 2024
0.7.0 Mar 8, 2021

#80 in WebSocket

Download history 54/week @ 2024-07-23 176/week @ 2024-08-27 1/week @ 2024-09-03 1/week @ 2024-09-10 3/week @ 2024-09-17 41/week @ 2024-09-24 175/week @ 2024-10-08 33/week @ 2024-10-15 102/week @ 2024-10-22 17/week @ 2024-10-29 22/week @ 2024-11-05

191 downloads per month

MIT license

115KB
2.5K SLoC

crates.io badge docs.rs badge

This is async-proto, a library crate facilitating simple binary network protocols with async support.

For a list of available Cargo features, see the crate-level documentation.


lib.rs:

This is async-proto, a library crate facilitating simple binary network protocols with async support.

The main feature is the Protocol trait, which allows reading a value of an implementing type from an async or sync stream, as well as writing one to an async or sync sink.

Protocol can be derived for enums and structs if all fields implement Protocol.

Features

This crate offers optional dependencies on the following crates to enable Protocol implementations for some of their types:

Additionally, the following features can be enabled via Cargo:

  • tokio-tungstenite: Adds a dependency on the tokio-tungstenite crate and convenience methods for reading/writing Protocol types from/to its websockets.
  • tungstenite: Adds a dependency on the tungstenite crate and convenience methods for synchronously reading/writing Protocol types from/to its websockets.

Dependencies

~3–12MB
~145K SLoC