87 releases
Uses new Rust 2024
| new 0.26.15 | May 2, 2026 |
|---|---|
| 0.26.14 | Mar 24, 2026 |
| 0.26.12 | Feb 22, 2026 |
| 0.26.8 | Dec 24, 2025 |
| 0.7.0 | Mar 8, 2021 |
#187 in WebSocket
190KB
3.5K
SLoC
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:
bitvec:BitVec<u8, Lsb0>bytes:Bytesbytesize:ByteSizechrono:NaiveDate,DateTime,Utc, andFixedOffsetchrono-tz:Tzdoubloon:Moneyand all ISO currencieseither:Eitherenumset:EnumSetgit2:Oidgix-hash:ObjectIdhematite-nbt:BlobandValuenoisy_float:NoisyFloatnonempty-collections:NEMap,NESet, andNEVecos_info:TypeandVersionrust_decimal:Decimalsemver:Version,Prerelease, andBuildMetadataserde_json:Value,Map, andNumberserenity: The ID types, not includingShardIdurl:Urluuid:Uuid
Additionally, this crate offers optional dependencies on the tokio-tungstenite crate to add convenience methods for reading/writing Protocol types from/to its websockets. The following versions are supported:
- The latest release (currently
tokio-tungstenite0.29, feature flagtokio-tungstenite029) - The version used by the
masterbranch ofrocket_wson GitHub (currentlytokio-tungstenite0.24, feature flagtokio-tungstenite024) - The version used by the latest
rocket_wscrates.io release (currentlytokio-tungstenite0.21, feature flagtokio-tungstenite021)
Dependencies
~3–15MB
~245K SLoC