Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![](https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white)](https://discord.com/invite/VkCG7Sb9Kw)

This is a hard fork of bincode 2.0.1 from crates.io (see first verbatim commit). Do not contact the original authors as per their wishes.
This is a **hard fork of bincode 2 (2.0.1) from crates.io** (see first verbatim commit). Do not contact the original authors as per their wishes.

A compact encoder / decoder pair that uses a binary zero-fluff encoding scheme.
The size of the encoded object will be the same or smaller than the size that
Expand All @@ -21,6 +21,7 @@ library.

## Bincode in the Wild

* [copper-rs](https://github.com/copper-project/copper-rs): copper-rs uses Bincode.
* [google/tarpc](https://github.com/google/tarpc): Bincode is used to serialize and deserialize networked RPC messages.
* [servo/webrender](https://github.com/servo/webrender): Bincode records WebRender API calls for record/replay-style graphics debugging.
* [servo/ipc-channel](https://github.com/servo/ipc-channel): IPC-Channel uses Bincode to send structs between processes using a channel-like API.
Expand Down Expand Up @@ -105,6 +106,6 @@ Bincode 2.0 has an MSRV of 1.85.0. Any changes to the MSRV are considered a brea

Bincode will encode enum variants as a `u32`. If you're worried about storage size, we can recommend enabling `Configuration::with_variable_int_encoding()`. This option is enabled by default with the `standard` configuration. In this case enum variants will almost always be encoded as a `u8`.

Currently we have not found a compelling case to respect `#[repr(...)]`. You're most likely trying to interop with a format that is similar-but-not-quite-bincode. We only support our own protocol ([spec](https://github.com/bincode-org/bincode/blob/trunk/docs/spec.md)).
Currently we have not found a compelling case to respect `#[repr(...)]`. You're most likely trying to interop with a format that is similar-but-not-quite-bincode. We only support our own protocol ([spec](https://github.com/copper-project/cu-bincode/blob/main/docs/spec.md)).

If you really want to use bincode to encode/decode a different protocol, consider implementing `Encode` and `Decode` yourself. `bincode-derive` will output the generated implementation in `target/generated/bincode/<name>_Encode.rs` and `target/generated/bincode/<name>_Decode.rs` which should get you started.
If you really want to use bincode to encode/decode a different protocol, consider implementing `Encode` and `Decode` yourself. `cu_bincode_derive` will output the generated implementation in `target/generated/cu_bincode/<name>_Encode.rs` and `target/generated/cu_bincode/<name>_Decode.rs` which should get you started.
6 changes: 3 additions & 3 deletions derive/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# cu-bincode-derive

This is a hard fork of bincode 2.0.1 from crates.io (see first verbatim commit). Do not contact the original authors as per their wishes.
This is a **hard fork of bincode 2 (2.0.1) from crates.io** (see first verbatim commit). Do not contact the original authors as per their wishes.

The derive crate for cu-bincode. Implements `bincode::Encode` and `bincode::Decode`.
The derive crate for cu-bincode. Implements `cu_bincode::Encode` and `cu_bincode::Decode`.

This crate is roughly split into 2 parts:

Expand All @@ -27,4 +27,4 @@ This is supported by the structs in `src/generate`. The most notable points of t

For additional derive testing, see the test cases in `../tests`

For testing purposes, all generated code is outputted to the current `target/generated/bincode` folder, under file name `<struct/enum name>_Encode.rs` and `<struct/enum name>_Decode.rs`. This can help with debugging.
For testing purposes, all generated code is outputted to the current `target/generated/cu_bincode` folder, under file name `<struct/enum name>_Encode.rs` and `<struct/enum name>_Decode.rs`. This can help with debugging.