| Crates.io | bencodex |
| lib.rs | bencodex |
| version | 0.2.1 |
| created_at | 2020-04-14 07:34:04.614717+00 |
| updated_at | 2023-09-25 23:48:39.225771+00 |
| description | bencode parser |
| homepage | https://github.com/Nomyfan/bencodex |
| repository | https://github.com/Nomyfan/bencodex |
| max_upload_size | |
| id | 229914 |
| size | 24,363 |
A bencode parser.
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();