Commit graph

5 commits

Author SHA1 Message Date
Profpatsch
3877243211 feat(users/Profpatsch/netencode): add decoder module
Decoders are implemented not directly on output types, but on trivial
proxy types, so that we can easily combine those into a decoder, and
then the associated type is the actual return value of the decoder.

Change-Id: Ibce98fa09fc944e02ab327112ec7ffbc09815830
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2455
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 11:10:00 +00:00
Profpatsch
ca52b29078 refactor(users/Profpatsch/netencode): rust read from stdin helper
Change-Id: I195c0212e224f676de5db37807731b814f99e818
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2452
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 11:10:00 +00:00
Profpatsch
a044a87084 fix(users/Profpatsch/netencode): remove Boxes in AST struct
Apparently HashMap and Vec already do internal boxing, so the extra
indirection in the value isn’t needed.

Then, in order to make things uniform, move the boxing of `Sum` into
the `Tag` value. No extra boxing in the recursion! \o/

Change-Id: Ic21d2e3e6ac0c6e1f045bf2c9d3e9c5af446fcff
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2443
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-27 13:41:18 +00:00
Profpatsch
27a73171cf feat(Profpatsch/netencode): add netencode-mustache
A little executable, combining the netencode and mustache libraries to
make easy templating from the command line possible.

Combined with the nix netencode generators, it’s now trivial to
populate a mustache template with (nearly) arbitrary data.

Yay.

Change-Id: I5b892c38fbc33dd826a26174dd9567f0b72e6322
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2320
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-03 16:29:57 +00:00
Profpatsch
f1c38e2560 feat(Profpatsch): dump netencode spec & parser
The netencode standard, a no-nonsense extension of netstrings for
structured data.

Includes a nix generator module and a rust parsing library.

Imported from
e409df3861/pkgs/profpatsch/netencode

Original license GPLv3, but I’m the sole author, so I transfer it to
whatever license depot uses.

Change-Id: I4f6fa97120a0fd861eeef35085a3dd642ab7c407
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2319
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:29:57 +00:00