rust-simple-bencode
Simple bencode decoder and decoder, that uses neither rustc-serialize or Serde. Instead, it serializes from / deserializes to a tree using a 4-branch enum."
Basic usage
This library is mainly composed of the read
and write
function, which serialize from and deserialize to this enum:
The signature of these functions are:
;
;
where DecodeError
is defined like this:
Working with byte arrays
If you work with byte arrays, these shortcuts should be useful to you:
;
;
## Helpers to deal with Value
Because some operations to read Value
are common, this library provides helpers to avoid error-handling boilerplate:
/// Pops a BValue::Integer from a HashMap.
;
/// Pops a BValue::String from a HashMap.
;
/// Pops a BValue::String from a HashMap and decode it into a Rust String.
;