Expand description
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:
bytes:Byteschrono:NaiveDate,DateTime,Utc, andFixedOffsetchrono-tz:Tzeither:Eitherenumset:EnumSetgit2:Oidgix-hash:ObjectIdnoisy_float:NoisyFloatsemver:Version,Prerelease, andBuildMetadataserde_json:Value,Map, andNumberserenity: The ID types, not includingShardIduuid:Uuid
Additionally, the following features can be enabled via Cargo:
tokio-tungstenite: Adds a dependency on thetokio-tungstenitecrate and convenience methods for reading/writingProtocoltypes from/to its websockets.tungstenite: Adds a dependency on thetungstenitecrate and convenience methods for synchronously reading/writingProtocoltypes from/to its websockets.
Macros§
- Implements
Protocolfor a type defined using thebitflags::bitflagsmacro.
Structs§
- The error returned from the
writeandwrite_syncmethods.
Enums§
- Provides additional information about the origin of an error.
- Specifies what went wrong while reading (receiving) a value.
- Specifies what went wrong while writing (sending) a value.
Traits§
- This trait 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.
Functions§
- websocket021
tokio-tungstenite021Establishes a WebSocket connection to the given URL and returns a typed sink/stream pair. - websocket024
tokio-tungstenite024Establishes a WebSocket connection to the given URL and returns a typed sink/stream pair.
Derive Macros§
- Implements the
Protocoltrait for this type.