about summary refs log tree commit diff
path: root/pkgs/profpatsch/netencode/netencode.rs
Commit message (Collapse)AuthorAgeFilesLines
* pkgs/profpatsch/netencode: Encode into U instead of TProfpatsch2020-07-061-45/+34
| | | | | | | | This is an experiment about whether we can get away with using the non-recursive version by default. The U::Record variant uses a Vec instead of a HashMap by default, to make encoding from lists easier, and keep the ordering as given.
* pkgs/profpatsch/netencode: actually enable parsing the binary typeProfpatsch2020-06-271-0/+2
|
* pkgs/profpatsch/netencode: add binary typeProfpatsch2020-06-261-0/+32
|
* pkgs/profpatsch/netencode: add support for boolProfpatsch2020-06-221-6/+30
| | | | | Instead of adding a new type, it just uses the 2^1 natural, which has exactly two possibilities.
* pkgs/profpatsch/netencode: add shallow parserProfpatsch2020-06-061-53/+160
| | | | | | | | | | | | | | | The “shallow” parser uses the fact that every netencode value is length-encoded (or a scalar with a fixed length). It does not need to parse the inner values in order to get the structure of the thing. That means that we can implement very fast structure-based operations, like “take the first 5 elements of a list” or “get the record value with the key name `foo`”. We can even do things like intersperse elements into a list of values and write the resulting netencode structure to a socket, without ever needing to copy the data (it’s all length-indexed pointers to bytes).
* pkgs/profpatsch: rename encode to netencodeProfpatsch2020-06-061-0/+399
Less generic, has the spirit of “netstrings, but extended to a structured encoding format”.