mirror of https://git.sr.ht/~stygianentity/bincode
Release 2.0.0-rc.1 (#510)
This commit is contained in:
parent
4d2e75e247
commit
fe611f77c0
|
|
@ -6,7 +6,7 @@ members = [
|
|||
|
||||
[package]
|
||||
name = "bincode"
|
||||
version = "2.0.0-beta.3" # remember to update html_root_url and bincode_derive
|
||||
version = "2.0.0-rc.1" # remember to update html_root_url and bincode_derive
|
||||
authors = ["Ty Overby <ty@pre-alpha.com>", "Zoey Riordan <zoey@dos.cafe>", "Victor Koenders <bincode@trangar.com>"]
|
||||
exclude = ["logo.svg", "examples/*", ".gitignore", ".github/"]
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ serde_alloc = ["serde_incl/alloc", "alloc"] # alloc
|
|||
serde_no_std = ["serde_incl"] # no_std
|
||||
|
||||
[dependencies]
|
||||
bincode_derive = { path = "derive", version = "2.0.0-beta.3", optional = true }
|
||||
bincode_derive = { path = "derive", version = "2.0.0-rc.1", optional = true }
|
||||
serde_incl = { package = "serde", version = "1.0", default-features = false, optional = true }
|
||||
|
||||
# Used for tests
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bincode_derive"
|
||||
version = "2.0.0-beta.3" # remember to update bincode
|
||||
version = "2.0.0-rc.1" # remember to update bincode
|
||||
authors = ["Zoey Riordan <zoey@dos.cafe>", "Victor Koenders <bincode@trangar.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Bincode 2 now has an optional dependency on `serde`. You can either use `serde`,
|
|||
|
||||
## From `Options` to `Configuration`
|
||||
|
||||
Bincode 1 had the [Options](https://docs.rs/bincode/1/bincode/config/trait.Options.html) trait. This has been replaced with the [Configuration](https://docs.rs/bincode/2.0.0-beta/bincode/config/struct.Configuration.html) struct.
|
||||
Bincode 1 had the [Options](https://docs.rs/bincode/1/bincode/config/trait.Options.html) trait. This has been replaced with the [Configuration](https://docs.rs/bincode/2.0.0-rc/bincode/config/struct.Configuration.html) struct.
|
||||
|
||||
If you're using `Options`, you can change it like this:
|
||||
|
||||
|
|
@ -43,10 +43,10 @@ Make sure to include bincode 2 with the `serde` feature enabled.
|
|||
|
||||
```toml
|
||||
[dependencies]
|
||||
bincode = { version = "2.0.0-beta", features = ["serde"] }
|
||||
bincode = { version = "2.0.0-rc", features = ["serde"] }
|
||||
|
||||
# Optionally you can disable the `derive` feature:
|
||||
# bincode = { version = "2.0.0-beta", default-features = false, features = ["std", "serde"] }
|
||||
# bincode = { version = "2.0.0-rc", default-features = false, features = ["std", "serde"] }
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -68,13 +68,13 @@ Then replace the following functions: (`Configuration` is `bincode::config::lega
|
|||
|
||||
```toml,ignore
|
||||
[dependencies]
|
||||
bincode = "2.0.0-beta"
|
||||
bincode = "2.0.0-rc"
|
||||
|
||||
# If you need `no_std` with `alloc`:
|
||||
# bincode = { version = "2.0.0-beta", default-features = false, features = ["derive", "alloc"] }
|
||||
# bincode = { version = "2.0.0-rc", default-features = false, features = ["derive", "alloc"] }
|
||||
|
||||
# If you need `no_std` and no `alloc`:
|
||||
# bincode = { version = "2.0.0-beta", default-features = false, features = ["derive"] }
|
||||
# bincode = { version = "2.0.0-rc", default-features = false, features = ["derive"] }
|
||||
```
|
||||
|
||||
Replace or add the following attributes. You are able to use both `serde-derive` and `bincode-derive` side-by-side.
|
||||
|
|
@ -84,7 +84,7 @@ Replace or add the following attributes. You are able to use both `serde-derive`
|
|||
|`#[derive(serde::Serialize)]`|`#[derive(bincode::Encode)]`|
|
||||
|`#[derive(serde::Deserialize)]`|`#[derive(bincode::Decode)]`|
|
||||
|
||||
**note:** To implement these traits manually, see the documentation of [Encode](https://docs.rs/bincode/2.0.0-beta/bincode/enc/trait.Encode.html) and [Decode](https://docs.rs/bincode/2.0.0-beta/bincode/de/trait.Decode.html).
|
||||
**note:** To implement these traits manually, see the documentation of [Encode](https://docs.rs/bincode/2.0.0-rc/bincode/enc/trait.Encode.html) and [Decode](https://docs.rs/bincode/2.0.0-rc/bincode/de/trait.Decode.html).
|
||||
|
||||
**note:** For more information on using `bincode-derive` with external libraries, see [below](#bincode-derive-and-libraries).
|
||||
|
||||
|
|
@ -105,10 +105,10 @@ Then replace the following functions: (`Configuration` is `bincode::config::lega
|
|||
|
||||
Currently not many libraries support the traits `Encode` and `Decode`. There are a couple of options if you want to use `#[derive(bincode::Encode, bincode::Decode)]`:
|
||||
- Enable the `serde` feature and add a `#[bincode(with_serde)]` above each field that implements `serde::Serialize/Deserialize` but not `Encode/Decode`
|
||||
- Enable the `serde` feature and wrap your field in [bincode::serde::Compat](https://docs.rs/bincode/2.0.0-beta/bincode/serde/struct.Compat.html) or [bincode::serde::BorrowCompat](https://docs.rs/bincode/2.0.0-beta/bincode/serde/struct.BorrowCompat.html)
|
||||
- Enable the `serde` feature and wrap your field in [bincode::serde::Compat](https://docs.rs/bincode/2.0.0-rc/bincode/serde/struct.Compat.html) or [bincode::serde::BorrowCompat](https://docs.rs/bincode/2.0.0-rc/bincode/serde/struct.BorrowCompat.html)
|
||||
- Make a pull request to the library:
|
||||
- Make sure to be respectful, most of the developers are doing this in their free time.
|
||||
- Add a dependency `bincode = { version = "2.0.0-beta", default-features = false, optional = true }` to the `Cargo.toml`
|
||||
- Implement [Encode](https://docs.rs/bincode/2.0.0-beta/bincode/enc/trait.Encode.html)
|
||||
- Implement [Decode](https://docs.rs/bincode/2.0.0-beta/bincode/de/trait.Decode.html)
|
||||
- Add a dependency `bincode = { version = "2.0.0-rc", default-features = false, optional = true }` to the `Cargo.toml`
|
||||
- Implement [Encode](https://docs.rs/bincode/2.0.0-rc/bincode/enc/trait.Encode.html)
|
||||
- Implement [Decode](https://docs.rs/bincode/2.0.0-rc/bincode/de/trait.Decode.html)
|
||||
- Make sure both of these implementations have a `#[cfg(feature = "bincode")]` attribute.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ Encoding an unsigned integer v (of any type excepting u8/i8) works as follows:
|
|||
|
||||
`usize` is being encoded/decoded as a `u64` and `isize` is being encoded/decoded as a `i64`.
|
||||
|
||||
See the documentation of [VarintEncoding](https://docs.rs/bincode/2.0.0-beta/bincode/config/struct.Configuration.html#method.with_variable_int_encoding) for more information.
|
||||
See the documentation of [VarintEncoding](https://docs.rs/bincode/2.0.0-rc/bincode/config/struct.Configuration.html#method.with_variable_int_encoding) for more information.
|
||||
|
||||
### FixintEncoding
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ See the documentation of [VarintEncoding](https://docs.rs/bincode/2.0.0-beta/bin
|
|||
- Enum discriminants are encoded as u32
|
||||
- Lengths and usize are encoded as u64
|
||||
|
||||
See the documentation of [FixintEncoding](https://docs.rs/bincode/2.0.0-beta/bincode/config/struct.Configuration.html#method.with_fixed_int_encoding) for more information.
|
||||
See the documentation of [FixintEncoding](https://docs.rs/bincode/2.0.0-rc/bincode/config/struct.Configuration.html#method.with_fixed_int_encoding) for more information.
|
||||
|
||||
## Enums
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
version = "2.0.0-beta.3"
|
||||
version = "2.0.0-rc.1"
|
||||
dependencies = [
|
||||
"bincode_derive",
|
||||
]
|
||||
|
|
@ -29,14 +29,14 @@ name = "bincode-fuzz"
|
|||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"bincode 1.3.3",
|
||||
"bincode 2.0.0-beta.3",
|
||||
"bincode 2.0.0-rc.1",
|
||||
"libfuzzer-sys",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bincode_derive"
|
||||
version = "2.0.0-beta.3"
|
||||
version = "2.0.0-rc.1"
|
||||
dependencies = [
|
||||
"virtue",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
//! [`net::TcpStream`]: std::net::TcpStream
|
||||
//!
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/bincode/2.0.0-beta.3")]
|
||||
#![doc(html_root_url = "https://docs.rs/bincode/2.0.0-rc.1")]
|
||||
#![crate_name = "bincode"]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue