Reference
Every public item, one page each.
42 items: 20 functions, 2 values, 10 structs, 7 enums, 2 errors, 1 trait, and 112 methods documented on the pages of the types they belong to. The signatures and the prose are both taken from the package — moon info for the first, the /// comments beside each declaration for the second — so a page here cannot describe a function that no longer exists.
Messages
| Item | Kind | Summary |
| Codec | trait | A value that knows how to become bytes, and how to come back from them. |
| dump | fn | The same, into a buffer the caller keeps: for a stream of messages written one after another, or for a buffer that already holds a header of its own. |
| dumps | fn | One value as one message: the head, the type ID, and the value. |
| load | fn | One value read out of a reader the caller owns, which is how several messages written one after another are read back: the reader keeps the position, and its configuration is the reader's. |
| loads | fn | Bytes as a value: the head is checked, the value is read, and the bytes left over are refused, because a message with two values in it is two messages. |
| read_message | fn | Read one complete message: the root's flag first, then the type ID. |
| Shared | struct | A value that may be written more than once, or that takes part in a cycle. |
| shared | fn | Mark a value as one that may be shared. |
| write_message | fn | Write a value as a complete message: the root's flag, the type ID, then everything after it. |
Configuration
| Item | Kind | Summary |
| Clashed | error | What OnClash::Panic raises: a setting given twice where the caller asked to hear about it. |
| Config | struct | What a reader will accept and what a writer will send. |
| config | let | The preset every entry point takes when it is not given one. |
| OnClash | enum | What to do when the same setting is given twice, once in the record and once as a flat argument. |
| resolve | fn | The configuration one call runs under. |
| Wins | enum | Which of the two ways of giving a configuration wins when both are given. |
Type IDs
| Item | Kind | Summary |
| TypeId | enum | The internal type ID: the byte that begins a value's type meta, and the number every language agrees on. |
Values
| Item | Kind | Summary |
| read_body | fn | Read the body of a value whose type is already known. |
| read_value | fn | Read a value: the type meta says what to build, and the body fills it. |
| Value | enum | A value whose type travels with it. |
| write_body | fn | Write the body of a value whose type meta is already on the wire: what a list element and a struct field are, once the header or the schema has said what they are. |
| write_value | fn | Write a value: the type meta that says what it is, then the body. |
| write_value_data | fn | Everything a value writes after its type ID: the user type ID for the kinds that carry one, then the body. |
Writing
| Item | Kind | Summary |
| root_key | let | The key the root value is tracked under, when tracking is on. |
| Writer | struct | Where a value goes: a buffer, the configuration it is written under, and the table of what has already been sent. |
Reading
| Item | Kind | Summary |
| Reader | struct | Where a value comes from: the bytes, the place in them, and what has been read already. |
| RefFlag | enum | What the byte before a value can say about it. |
Schemas
| Item | Kind | Summary |
| compare_field | fn | Which of two fields comes first, by the rules the specification lays down so that every language writes the same order. |
| FieldMeta | struct | One field of a struct: the description it carries, and what the wire needs that a description has no word for. |
| StructMeta | struct | A struct type: the description every projection shares, the user type ID it is registered under, and one wire record per field. |
Row format
| Item | Kind | Summary |
| Row | struct | A builder for one row. |
| RowCursor | struct | A reader over one row's bytes, with random access to any field. |
| RowField | struct | One field of a row schema: its name, its type, and whether it may be null. |
| RowSchema | struct | A row schema: the ordered list of fields a row is built and read against. |
| RowType | enum | The type of one field in a row schema. |
| RowValue | enum | A value written into, or read out of, a row. |
Time
| Item | Kind | Summary |
| date_of_days | fn | The day count of a date, as the wire carries it: days since 1970-01-01. |
| days_of_date | fn | The days since 1970-01-01 for a date. |
| moment_of_parts | fn | The moment seconds after the epoch, plus nanos nanoseconds. |
| parts_of_moment | fn | The whole seconds and the sub-second nanoseconds of a moment. |
| parts_of_span | fn | The whole seconds and the sub-second nanoseconds of a span. |
| span_of_parts | fn | The span from seconds and nanos. |
Refusals
| Item | Kind | Summary |
| Refused | error | Why a message was refused. |
Regenerated, not written. python3 scripts/api.py writes this directory from src/pkg.generated.mbti and src/*.mbt; CI runs it and refuses a diff. A method links to its type's page under an anchor rather than to a page of its own, because a method is only readable next to the type it hangs off.