Module nix_compat::derivation::parser
source · Expand description
This module constructs a Derivation by parsing its ATerm serialization.
Enums§
Functions§
- Consume a string containing the algo, and optionally a
r:
prefix, and a digest (bytes), return a CAHash::Nar or CAHash::Flat. - parse 🔒
- parse_kv 🔒Parse a list of key/value pairs into a BTreeMap. The parser for the values can be passed in. In terms of ATerm, this is just a 2-tuple, but we have the additional restriction that the first element needs to be unique across all tuples.
- Parse one output in ATerm. This is 4 string fields inside parans: output name, output path, algo (and mode), digest. Returns the output name and Output struct.
- Parse multiple outputs in ATerm. This is a list of things acccepted by parse_output, and takes care of turning the (String, Output) returned from it to a BTreeMap. We don’t use parse_kv here, as it’s dealing with 2-tuples, and these are 4-tuples.