bincode 1.3 → 3.0SUPERSEDED (2026-07-25) — do not follow this document.
Three of its premises are now false:
- The 3.0 target no longer exists as usable software. bincode was abandoned after a doxxing/harassment incident and the repository was archived on 2025-08-15. Version 3.0.0 (published 2025-12-16) is a tombstone: per the crate's own docs.rs notice it "contains only this README, as well as a lib.rs containing only a compiler error, to inform potential users of the maintenance status." docs.rs failed to build it. Depending on it breaks the build by design.
- The serde-adapter attribution below is wrong. The
bincode::serdeadapter module described as a 3.0 feature is in fact a 2.0 feature.- The migration was completed as 1.3 → 2.0, not 1.3 → 3.0, via the
serialization::bincode_compatshim pinned tobincode::config::legacy()(fixint little-endian) so the wire format stayed byte-identical to 1.x. Seedocs/algorithms/serialization.mdfor the contract that shim upholds.
Cargo.tomlnow pinsbincode = ">=2.0, <3"to make walking into the tombstone impossible. The live plan is migration to the maintainedbincode-nextfork, gated behind a byte-pinning and golden-fixture safety net.Retained unedited below for historical context.
Migrate the serialization feature off bincode 1.3.x onto a
current-major release.
Cargo.toml pins bincode = { version = "1.3", optional = true }.cargo search bincode --limit 1 confirmed at session close.bincode 1.x uses serde-compatible APIs (bincode::serialize_into(&mut writer, &value), bincode::deserialize_from(&mut reader)). bincode
2.0 dropped serde support out of the box and introduced its own
Encode / Decode derive macros. bincode 3.0 reintroduced serde via
a bincode::serde adapter module but kept the new APIs.
For 3.0 the call-sites change from:
bincode::serialize_into(&mut writer, &terms)?;
let terms: Vec<String> = bincode::deserialize_from(&mut reader)?;
to:
let config = bincode::config::standard();
bincode::serde::encode_into_std_write(&terms, &mut writer, config)?;
let (terms, _len): (Vec<String>, usize) =
bincode::serde::decode_from_std_read(&mut reader, config)?;
src/serialization/bincode_impl.rs — primary sitesrc/serialization/protobuf_impl.rs — uses bincode for SuffixAutomaton
source-text encodingsrc/serialization/compression_impl.rs — gzip wrapper around bincode(Each step a commit.)
bincode = { version = "3.0", features = ["serde"], optional = true }
For each BincodeSerializer::* method, replace the bincode 1.x call
with the bincode 3.x equivalent. Use bincode::config::standard() as
the default config (matches bincode 1.x defaults).
grep -rn 'bincode::' src/persistent_artrie src/persistent_artrie_char src/persistent_artrie_core src/persistent_vocab_artrie.
Each serialize_into / deserialize_from call needs migration.
bincode 3.0's wire format is not byte-compatible with bincode 1.x.
Every persistent dictionary written with the old version becomes
unreadable. Bump the format-version constant in
src/persistent_artrie_core/disk_manager.rs and add a migration helper
that reads the old version with a vendored bincode 1.x decoder, then
re-writes with bincode 3.0.
cargo test --all-features --no-fail-fast — must remain at 2288+.tests/bincode_migration.rs that verify a file written
with the old version can be migrated.Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |