Module sources

Source
Expand description

ConfigurationSources: Helper for handling configuration files

This module provides ConfigurationSources.

This layer brings together the functionality of our underlying configuration library, fs_mistrust and tor_config::cmdline.

A ConfigurationSources records a set of filenames of TOML files, ancillary instructions for reading them, and also a set of command line options.

Usually, call ConfigurationSources::from_cmdline, perhaps set_mistrust, and finally load. The resulting ConfigurationTree can then be deserialized.

If you want to watch for config file changes, use ConfigurationSources::scan(), to obtain a FoundConfigFiles, start watching the paths returned by FoundConfigFiles::iter(), and then call FoundConfigFiles::load(). (This ordering starts watching the files before you read them, which is necessary to avoid possibly missing changes.)

Structs§

ConfigurationSources
A description of where to find our configuration options.
FoundConfigFile 🔒
A configuration source file or directory, found or not found on the filesystem
FoundConfigFiles
Configuration files and directories we found in the filesystem

Enums§

ConfigurationSource
A configuration file or directory, for use by a ConfigurationSources
MustRead
Rules for whether we should proceed if a configuration file is unreadable.

Functions§

is_syntactically_directory 🔒
Does it end in a slash? (Or some other way of saying this is a directory.)