bencodex

Crates.iobencodex
lib.rsbencodex
version0.2.1
sourcesrc
created_at2020-04-14 07:34:04.614717
updated_at2023-09-25 23:48:39.225771
descriptionbencode parser
homepagehttps://github.com/Nomyfan/bencodex
repositoryhttps://github.com/Nomyfan/bencodex
max_upload_size
id229914
size24,363
Kim Chan (nomyfan)

documentation

README

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();
Commit count: 12

cargo fmt