Module shadow_rs::core::configuration
source · Expand description
Shadow’s configuration and cli parsing code using serde and clap. This contains all of Shadow’s configuration options, some of which are also exposed as CLI options.
Shadow uses schemars to get the option description (its doc comment) and default value so that it can be shown in the CLI help text.
This code should be careful about validating or interpreting values. It should be focused on parsing and checking that the format is correct, and not validating the values. For example for options that take paths, this code should not verify that the path actually exists or perform any path canonicalization. That should be left to other code outside of this module. This is so that the configuration parsing does not become environment-dependent. If a configuration file parses on one system, it should parse successfully on other systems as well.
Structs§
- Options contained in a configuration file.
- Shadow configuration options after processing command-line and configuration file options.
Enums§
- This wrapper type allows cli options to specify “null” to overwrite a config file option with
None
, and is intended to be used for options where “null” is a valid option value. - The enum variants here have an extra level of indirection to get the serde serialization that we want.
Constants§
Traits§
- A trait for
Option
-like types that can be flattened into a singleOption
.
Functions§
- Parses a string as a list of arguments following the shell’s parsing rules. This uses
g_shell_parse_argv()
for parsing.