55 releases

new 0.19.6 Apr 24, 2024
0.19.5 Mar 31, 2024
0.18.0 Feb 16, 2024
0.17.0 Dec 13, 2023
0.7.0 Mar 8, 2021

#59 in WebSocket

Download history 201/week @ 2024-02-15 61/week @ 2024-02-22 295/week @ 2024-02-29 97/week @ 2024-03-07 29/week @ 2024-03-14 399/week @ 2024-03-28 49/week @ 2024-04-04 5/week @ 2024-04-11

453 downloads per month

MIT license

85KB
1.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.
  • warp: Adds a dependency on the warp crate and convenience methods for reading/writing Protocol types from/to its websockets.

Dependencies

~3–17MB
~200K SLoC