pub trait LoadConfig {
// Required methods
fn try_load_config(self) -> Result<Config, ExtractConfigError>;
fn load_config(self) -> Config;
fn load_config_and_evm_opts(self) -> Result<(Config, EvmOpts)>;
fn load_config_unsanitized(self) -> Config;
fn try_load_config_unsanitized(self) -> Result<Config, ExtractConfigError>;
fn load_config_emit_warnings(self) -> Config;
fn try_load_config_emit_warnings(self) -> Result<Config, ExtractConfigError>;
fn load_config_and_evm_opts_emit_warnings(self) -> Result<(Config, EvmOpts)>;
fn load_config_unsanitized_emit_warnings(self) -> Config;
fn try_load_config_unsanitized_emit_warnings(
self,
) -> Result<Config, ExtractConfigError>;
}
Expand description
Helpers for loading configuration.
This is usually implicitly implemented on a “&CmdArgs” struct via impl macros defined in
forge_config
(see [foundry_config::impl_figment_convert
] for more details) and the impl
definition on T: Into<Config> + Into<Figment>
below.
Each function also has an emit_warnings
form which does the same thing as its counterpart but
also prints Config::__warnings
to stderr
Required Methods§
Sourcefn try_load_config(self) -> Result<Config, ExtractConfigError>
fn try_load_config(self) -> Result<Config, ExtractConfigError>
Load and sanitize the [Config
] based on the options provided in self
Returns an error if loading the config failed
Sourcefn load_config(self) -> Config
fn load_config(self) -> Config
Load and sanitize the [Config
] based on the options provided in self
Sourcefn load_config_and_evm_opts(self) -> Result<(Config, EvmOpts)>
fn load_config_and_evm_opts(self) -> Result<(Config, EvmOpts)>
Load and sanitize the [Config
], as well as extract EvmOpts
from self
Sourcefn load_config_unsanitized(self) -> Config
fn load_config_unsanitized(self) -> Config
Load [Config
] but do not sanitize. See [Config::sanitized
] for more information
Sourcefn try_load_config_unsanitized(self) -> Result<Config, ExtractConfigError>
fn try_load_config_unsanitized(self) -> Result<Config, ExtractConfigError>
Load [Config
] but do not sanitize. See [Config::sanitized
] for more information.
Returns an error if loading failed
Sourcefn load_config_emit_warnings(self) -> Config
fn load_config_emit_warnings(self) -> Config
Same as LoadConfig::load_config
but also emits warnings generated
Sourcefn try_load_config_emit_warnings(self) -> Result<Config, ExtractConfigError>
fn try_load_config_emit_warnings(self) -> Result<Config, ExtractConfigError>
Same as LoadConfig::load_config
but also emits warnings generated
Returns an error if loading failed
Sourcefn load_config_and_evm_opts_emit_warnings(self) -> Result<(Config, EvmOpts)>
fn load_config_and_evm_opts_emit_warnings(self) -> Result<(Config, EvmOpts)>
Same as LoadConfig::load_config_and_evm_opts
but also emits warnings generated
Sourcefn load_config_unsanitized_emit_warnings(self) -> Config
fn load_config_unsanitized_emit_warnings(self) -> Config
Same as LoadConfig::load_config_unsanitized
but also emits warnings generated