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

#196 in Encoding

Download history 2953/week @ 2024-10-18 3149/week @ 2024-10-25 4300/week @ 2024-11-01 2972/week @ 2024-11-08 3843/week @ 2024-11-15 3433/week @ 2024-11-22 5524/week @ 2024-11-29 4619/week @ 2024-12-06 4808/week @ 2024-12-13 2600/week @ 2024-12-20 1975/week @ 2024-12-27 3854/week @ 2025-01-03 4258/week @ 2025-01-10 5004/week @ 2025-01-17 4368/week @ 2025-01-24 4015/week @ 2025-01-31

18,133 downloads per month
Used in 18 crates (11 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

~195–455KB
~10K SLoC