Skip to main content

Module dotted

Module dotted 

Source
Expand description

Dotted keys over the config tree (session.tool_profile, agents.build.model, mcp_servers."my.server".command).

Read side: lookup, leaves, render work on the serialized crate::Config (toml::Value), and redact hides secret values. Write side: [set_in_document] changes one key of a TOML document and keeps every other key, comment and blank line as it was.

A segment that meets an array picks an element: a number is an index, anything else the table whose name equals it (agents.build).

Constants§

REDACTED
Printed in place of a secret value.

Functions§

format_key
The dotted form of path, quoting segments that are not bare keys.
is_secret_key
True when the key at path holds a secret: the last segment is (or ends in _ plus) one of api_key, apikey, token, secret, password, webhook, webhook_url, authorization; or it is key under providers; or it sits directly in a headers table.
leaves
Every leaf under root with its path, sorted by path. Tables recurse, and so do arrays of tables (each element by its name, else its index); scalars, other arrays and empty tables are leaves.
lookup
The value at path, if any.
parse_key
Split a dotted key into segments (TOML dotted-key syntax, so a segment with a dot in it is quoted: models."gpt-4.1").
redact
value, found at path, with every secret string under it replaced by REDACTED. ${NAME} references are kept.
render
A value for people: strings bare, tables as a TOML document, the rest as a TOML literal.