Crate benko[][src]

A zero dependency Bencode parsing library.

To get started try passing a bencoded byte array to Benc::parse().

Modules

convert

The implementations for the WrapBenc, and UnwrapBenc traits, which allow converting the Benc enum to and from its constituent types (BInt, BStr, BVec, BMap). Used when destructuring the Benc tree into a struct or when parsing values.

encode

The implementations for the EncodeBencode trait. Which allow a Benc enum to be encoded back into an array of ascii bytes.

parse

The implementations for the ParseBenc trait, that allows a sequence of bytes to be read into a Bencode type: (BInt, BStr, BVec, BMap).

util

A Collection of internal helper functions for the library.

Structs

BMapImpl

Implementation: A HashMap wrapper that clones the contained Benc items when self.get() is called to avoid causing a move on the un-Copy-able type Benc.

Enums

Benc

The nested Bencode structure container.

Type Definitions

BInt

A Bencode Integer, (format: “i[value]e”)

BMap

A Bencode Dictionary of ByteString keys and any other bencode as values, (format: “d[bencode items]e”)

BStr

A Bencode ByteString, (format: “[length]:[bytes]”)

BVec

A Bencode List of other Bencode types, (format: “l[bencode objects]e”)