Crate dialectic_tokio_serde[−][src]
This crate provides an interface to build a family of backend implementations using the
serde
crate to transport Serialize
and Deserialize
values by reference across
any AsyncRead
and AsyncWrite
transports. In order to use it, you will need to depend on
some other crate which provides the definition of a serialization format; none such are defined
here.
To use this backend, select:
- a particular serialization format, such as from the
dialectic_tokio_serde_bincode
ordialectic_tokio_serde_json
crates, - a particular
codec
for encoding and decoding frames, and - your choice of
AsyncRead
andAsyncWrite
reader and writer.
Then, use symmetrical
(_with_capacity
) to
construct a pair of Sender
and Receiver
.
If your outgoing and incoming streams are encoded or serialized differently, or your
serialization or encoding format is not Clone
, use Sender::new
and Receiver::new
directly to construct each end of the connection.
Re-exports
pub use tokio_util::codec; |
Structs
Receiver | A |
Sender | A |
Enums
Error | An error during operations on a |
RecvError | An error while receiving from a |
SendError | An error while sending on a |
Traits
Deserializer | The deserialization end of a serialization format: an object which can deserialize to any
non-lifetime-restricted |
Serializer | The serialization end of a serialization format: an object which can serialize any |
Functions
symmetrical | Create a |
symmetrical_with_capacity | Create a |
Type Definitions
SymmetricalChan | A |
SymmetricalError | Shorthand for an |