66 releases
Uses new Rust 2024
new 0.24.3 | Mar 13, 2025 |
---|---|
0.24.1 | Oct 25, 2024 |
0.22.1 | Jun 14, 2024 |
0.19.5 | Mar 31, 2024 |
0.7.0 | Mar 8, 2021 |
#83 in WebSocket
83 downloads per month
140KB
2.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 enum
s and struct
s if all fields implement Protocol
.
Features
This crate offers optional dependencies on the following crates to enable Protocol
implementations for some of their types:
bytes
:Bytes
chrono
:NaiveDate
,DateTime
,Utc
, andFixedOffset
chrono-tz
:Tz
doubloon
:Money
and all ISO currencieseither
:Either
enumset
:EnumSet
git2
:Oid
gix-hash
:ObjectId
noisy_float
:NoisyFloat
rust_decimal
:Decimal
semver
:Version
,Prerelease
, andBuildMetadata
serde_json
:Value
,Map
, andNumber
serenity
: The ID types, not includingShardId
uuid
:Uuid
Additionally, the following features can be enabled via Cargo:
tokio-tungstenite
: Adds a dependency on thetokio-tungstenite
crate and convenience methods for reading/writingProtocol
types from/to its websockets.tungstenite
: Adds a dependency on thetungstenite
crate and convenience methods for synchronously reading/writingProtocol
types from/to its websockets.
Dependencies
~3–13MB
~148K SLoC