Document making serde an optional dependency (#746)

This commit is contained in:
Trangar 2025-03-02 16:59:41 +01:00 committed by GitHub
parent f98bc70757
commit 4488a6496a
1 changed files with 11 additions and 0 deletions

View File

@ -52,8 +52,19 @@
//!
//! **Using any of the above attributes can and will cause issues with bincode and will result in lost data**. Consider using bincode's own derive macro instead.
//!
//! # Why move away from serde?
//!
//! Serde is a great library, but it has some issues that makes us want to be decoupled from serde:
//! - The issues documented above with attributes.
//! - Serde has chosen to not have a MSRV ([source](https://github.com/serde-rs/serde/pull/2257)). We think MSRV is important, bincode 1 still compiles with rust 1.18.
//! - Before serde we had rustc-serializer. Serde has more than replaced rustc-serializer, but we can imagine a future where serde is replaced by something else.
//! - We believe that less dependencies is better, and that you should be able to choose your own dependencies. If you disable all features, bincode 2 only has 1 dependency. ([`unty`], a micro crate we manage ourselves)
//!
//! **note:** just because we're making serde an optional dependency, it does not mean we're dropping support for serde. Serde will still be fully supported, we're just giving you the option to not use it.
//!
//! [Decode]: ../de/trait.Decode.html
//! [Encode]: ../enc/trait.Encode.html
//! [`unty`]: https://crates.io/crates/unty
mod de_borrowed;
mod de_owned;