#bencode #serialize #deserialize #serde

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

#153 in Parser implementations

Download history 492/week @ 2023-08-11 804/week @ 2023-08-18 1049/week @ 2023-08-25 850/week @ 2023-09-01 1565/week @ 2023-09-08 1320/week @ 2023-09-15 527/week @ 2023-09-22 764/week @ 2023-09-29 1124/week @ 2023-10-06 1360/week @ 2023-10-13 995/week @ 2023-10-20 939/week @ 2023-10-27 1173/week @ 2023-11-03 1095/week @ 2023-11-10 1310/week @ 2023-11-17 1002/week @ 2023-11-24

4,784 downloads per month
Used in 21 crates (16 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

~140–385KB