4 releases

0.2.1 Sep 25, 2023
0.2.0 Sep 25, 2023
0.1.3 May 9, 2020
0.1.2 Apr 16, 2020

#7 in #bencode

MIT license

21KB
581 lines

bencodex

A bencode parser.

Get Started

use bencodex::{BDict, BNode};

let mut dict = BDict::new();
dict.insert("bar".to_string(), "spam".into());
dict.insert("foo".to_string(), 42.into());

let bnode = BNode::Dict(dict);

let mut file = File::create(
  env::current_dir().unwrap().join("name.torrent")
).unwrap();
bnode.serialize(&mut file).unwrap();

No runtime deps