A bencode parser written with nom. ```rust let data = parse(b"d3:cow3:moo4:spam4:eggse").unwrap(); let v = data.first().unwrap(); assertmatches!(v, Value::Dictionary());
if let Value::Dictionary(dict) = v { let v = dict.get("cow".asbytes()).unwrap(); assertmatches!(*v, Value::Bytes(b"moo"));
let v = dict.get("spam".as_bytes()).unwrap();
assert_matches!(*v, Value::Bytes(b"eggs"));
}
let (, v) = Value::parsedict(b"d4:spaml1:a1:bee").unwrap(); assertmatches!(v, Value::Dictionary());
if let Value::Dictionary(dict) = v { let v = dict.get("spam".asbytes()).unwrap(); assertmatches!(*v, Value::List(_)); } ```
License: MIT OR Apache-2.0