tokio-bincode

Bincode based `tokio-codec` adapter

MIT License

Downloads
1.9K
Stars
4
Committers
1

tokio-bincode

Bincode based tokio-codec adapter.

Usage

First, add this to your Cargo.toml:

[dependencies]
tokio-bincode = "0.1"

Then you can use it like so:

#[derive(Serialize, Deserialize)]
struct MyProtocol;

// Create the codec based on your custom protocol
let codec = BinCodec::<MyProtocol>::new();

// Frame the transport with the codec to produce a stream/sink
let (sink, stream) = Framed::new(transport, codec).split();

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokio-bincode by you, shall be licensed as MIT, without any additional terms or conditions.