Skip to main content

Module config

Module config 

Source
Expand description

The application root (spec §7), config.toml strict reads (spec §17) and locked, atomic writes (spec §18, §18.1).

Structs§

AppRoot
The directory holding config.toml and profiles/.
Config
The validated contents of config.toml.
Mapping
One [repositories.'<root>'] entry (SP3 design §6.1).
Reference
A mapping field that names a profile (SP3 design §4.2).

Enums§

LinkOutcome
What link did.
UnlinkOutcome
What unlink did.

Constants§

CONFIG_FILE 🔒
HOME_ENV
Environment variable that overrides the application root.
LOCK_FILE 🔒
LOCK_RETRY 🔒
LOCK_TIMEOUT 🔒
TEMP_PREFIX 🔒
TEMP_SUFFIX 🔒

Functions§

acquire 🔒
check_case_twins 🔒
Refuses a profile whose name differs from an existing profiles/ entry only in ASCII case (SP1 design §7.3).
child_table 🔒
The table at key in parent, created when missing: an inline table when inline, otherwise an implicit standard table.
invalid 🔒
is_absolute_key 🔒
Absolute in Unix form (/…) or Windows form (C:\…, C:/…, \\…), whatever the host (SP3 design §6.1).
is_host_form_key
Whether a stored key is in this host’s own absolute form: /… on Unix, anything but /… on Windows (SP5b design §4). The other platform’s keys are foreign.
link
Maps repository (or only agent in it) to profile (SP3 design §6.2). The caller has discovered repository.
link_outcome 🔒
locked
Reads the configuration under the same exclusive lock as update (spec §18, design §6.4). It does not create the root directory and does not sweep temp files: those are write-path side effects.
mapped 🔒
The profile an entry maps at the field agent selects.
parse 🔒
profile_name 🔒
repository_key 🔒
repositories.<key> with the key quoted as TOML would write it.
stored_keys 🔒
The stored repositories keys of a validated document.
unlink
Removes the mapping at the first of keys that has one at that field, under one lock (SP3 design §6.2). keys is never empty.
update
Locked, atomic read-modify-write of config.toml (spec §18, design §6.4).
update_with 🔒
validate 🔒
Applies the strict schema (SP1 design §6.2, SP3 design §6.1) to a parsed document.
validate_agents 🔒
validate_repositories 🔒