The dialectic-tokio-serde crate provides Dialectic
Transmitter and Receiver types which are capable of sending/receiving any
serde-Serialize/Deserialize type. These are generic over their transport, and require three
additional parameters to function:
- Async-capable writer/reader types which implement the Tokio
AsyncWriteandAsyncReadtraits. - A Tokio codec, for encoding and decoding frames which are written to/read from the asynchronous writer/reader.
- A
dialectic_tokio_serde::Serializer/Deserializerfor converting the sent/received types to/from the wire format. PLEASE NOTE! These are not the serdeSerializer/Deserializertraits but rather similar traits which also define the possible output/input types of theSerializer/Deserializer.
Tokio/serde backends for Dialectic
Currently, two formats are implemented as sister crates:
- The
dialectic-tokio-serde-bincodecrate, which when provided anAsyncWrite/AsyncReadtransport enables serialization to/from the bincode format and using thetokio_utilLengthDelimitedCodecfor a wire encoding. - The
dialectic-tokio-serde-jsoncrate, which when provided anAsyncWrite/AsyncReadtransport enables serialization to/from the JSON format and using thetokio_utilLinesCodecfor a wire encoding.