#bencode #serde #deserialize

serde_bencode

A Serde backed Bencode encoding/decoding library for Rust

9 releases

0.2.4 Oct 9, 2023
0.2.3 Dec 1, 2020
0.2.2 Jul 17, 2020
0.2.1 Feb 10, 2020
0.1.1 Dec 21, 2016

#129 in Encoding

Download history 3441/week @ 2025-09-23 4867/week @ 2025-09-30 4798/week @ 2025-10-07 5689/week @ 2025-10-14 4244/week @ 2025-10-21 4166/week @ 2025-10-28 5185/week @ 2025-11-04 5814/week @ 2025-11-11 5538/week @ 2025-11-18 4458/week @ 2025-11-25 4892/week @ 2025-12-02 4512/week @ 2025-12-09 4680/week @ 2025-12-16 3568/week @ 2025-12-23 3606/week @ 2025-12-30 4284/week @ 2026-01-06

16,803 downloads per month
Used in 112 crates (22 directly)

MIT license

65KB
1.5K SLoC

Serde Bencode

Checking Formatting Testing Benchmarking Coverage Crates.io docs.rs

A Serde backed Bencode encoding/decoding library for Rust.

Installation

Add the following to your Cargo.toml:

[dependencies]
serde_bencode = "^0.2.4"
serde = "^1.0.0"
serde_derive = "^1.0.0"

Usage

This is an abbreviated .torrent parsing example from examples/parse_torrent.rs. If you compile this crate as a binary, it will print metadata for any Torrent sent to stdin.

Benchmarking

cargo bench

Dependencies

~185–500KB
~11K SLoC