Std.Toml.Read.read
1 declaration
fn
read: Str -> Result[Std.Toml.Toml, Std.Toml.TomlError]This is a callable function.
What it does
A configuration read from text.
The document is built as it is read rather than collected and assembled
afterwards, because a section header changes where every later key belongs:
a reader that gathered keys first would have to remember which header each
arrived under, which is the same bookkeeping done less directly.
Tables under construction are drafts held side by side and named by
position, each keeping its keys in written order and a map from key to where
it points. Placing a key is one map lookup per segment of its path, so the
work does not grow with how many keys the table already holds. The drafts
become the finished value once, when the text has been read.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
- Result makes success and recoverable failure part of the function's type.
