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
The following features can be enabled via Cargo:
blocking: Shorthand for enabling bothread-syncandwrite-sync.chrono-tz: Adds a dependency on thechrono-tzcrate and implements [Protocol] for itsTztype.read-sync: Adds a blockingread_syncmethod to the [Protocol] trait.serde_json: Adds a dependency on theserde_jsoncrate and implements [Protocol] for itsValue,Map, andNumbertypes.tokio-tungstenite: Adds a dependency on thetokio-tungstenitecrate and convenience methods for reading/writing [Protocol] types from/to its websockets.warp: Adds a dependency on thewarpcrate and convenience methods for reading/writing [Protocol] types from/to its websockets.write-sync: Adds a blockingwrite_syncmethod to the [Protocol] trait.