Expand description
What the codec that constructo codegen generates calls and needs no trait for: the error of reading or writing a
value, the setting of how names are written, the parts of a record and a tuple in the order of their declaration,
the numbers, and the builders of a tree.
The traits and the tables of names and consts are generated with each codec, in the program’s own crate, so that
they can be implemented for a type of any crate. What is here is the same for every codec. Its messages are those of
constructo check, where the error is one that check finds.
Structs§
- Error
- An error of reading or of writing a value.
Enums§
- Names
- How a codec writes the name of a constructor.
- NoDefault
- Why a type has no default that can be used where an argument is left out.
- Step
- A step of the path from the value that was read or written to the value that an error is about.
Functions§
- arguments
- The arguments of a constructor with a tuple, in the order of its parameters, which are given by their names, or
Nonefor a parameter that has none. The arguments without a name bind the parameters in order, and those with a name bind the parameter of that name, which may be one that could have been bound in order. A named parameter that is not bound isNone, and takes the default of its type; an unnamed one is an error. The errors arecheck’s, in its order. - array
- An array.
- enter
- The depth of a value inside one at
depth, which is an error if it is more thanmax. Each value is a level, a scalar included, as the parser counts them, so a value that is read is never deeper than one that the parser reads, and one that is written can be read back. - expected
- The error for a value that is not of the type that is expected:
Expected Nat but found String. - fields
- The members of a record, or of a constructor with a record, in the order of
names, which are the fields. Every field is required and no other is allowed, and the errors arecheck’s, in its order: a duplicate or an unknown field at the member, then a missing one at the record.owneris the constructor, orrecordfor a record without a name. - float
- A
Float, as the shortest text that reads back as the samef64. Rust’s own shortest text is used, with.0put in where it has no point, as in1.0e300, and a zero is written as0.0, since there is no negative zero. A value that is not finite has no text yet, and is an error. - found
- What a value is, for a message, as
checksays it:Nat,Int,Float,String,an arrayora record. A tagged value is its name as it is written, which a codec can give with its type. - int
- An
Int, with its sign, which a number that is not negative has as+, asconvertwrites it. - is_
const_ name - Whether a name is that of a const, which starts with a lower-case letter or
_, after any qualifier, as a constructor starts with a capital letter (decision 35). - nat
- A
Nat. - no_
default - The error for an argument that is left out, at the constructor, where its type has no default that can be used. The
messages are
check’s, with the codec’s limit, andparamis the name of the parameter. - parse
- The values of a text.
- parse_
one - The one value of a text, which is an error at the start of the text if it has more or fewer.
- read_
float - A
Floatfrom its text, or from that of aNator anIntifwideningis set: the nearestf64, which is the one loss that a mapping is allowed. A number too small to be held other than as zero is zero, and one too large for anf64, such as1.0e400, is an error at it, since making it infinite would change a finite value into one that is not. There is no negative zero, so-0.0is0.0. - read_
int - An
Intfrom its text, or from that of aNatifwideningis set. A number that is too large for ani64is an error at it. - read_
nat - A
Natfrom its text. A sign makes a number anInt, which is never aNat, as incheck, and a number that is too large for au64is an error at it. - read_
string - A string from its value.
- record
- A record without a name, with its members in the order given.
- spend
- Counts a node of a default against what is left of the limit.
- string
- A
String. - tagged_
array - A constructor with an array.
- tagged_
record - A constructor with a record.
- tagged_
tuple - A constructor with a tuple, each argument with its name if it is written by name.
- unit
- A constructor with no body, or a reference to a const.
- write_
text - The text of the values, each ended by
;and a new line, asconvertwrites them.