Module tor_config::sources

source ·
Expand description

ConfigurationSources: Helper for handling configuration files

This module provides ConfigurationSources.

This layer brings together the functionality of [config::File], [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 [config::Config] 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

Enums

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