Crates.io | tokio-bincode |
lib.rs | tokio-bincode |
version | 0.1.0 |
source | src |
created_at | 2019-04-06 16:26:20.863994 |
updated_at | 2019-04-06 16:26:20.863994 |
description | Bincode based `tokio-codec` adapter. |
homepage | |
repository | https://github.com/LucioFranco/tokio-bincode |
max_upload_size | |
id | 126186 |
size | 10,600 |
Bincode based tokio-codec
adapter.
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();
This project is licensed under the MIT license.
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.