Module wildland_cargo_lib::api::config
source · [−]Expand description
This module consists of types and functions for creating configuration of super::CargoLib
.
Configuration may be represented by a JSON like:
let config_json = r#"{
"log_level": "trace",
"log_use_ansi": false,
"log_file_enabled": true,
"log_file_path": "cargo_lib_log",
"log_file_rotate_directory": ".",
"evs_runtime_mode": "DEBUG",
"evs_url": "some_url",
"sc_url": "some_url"
}"#;
let _ = parse_config(config_json.as_bytes().to_vec()).unwrap();
It can be also provided via type implementing CargoCfgProvider
.
Structs
Structure representing configuration for
super::CargoLib
initialization.Structure representing configuration of
super::CargoLib
.
It is used to create super::CargoLib
instance.
It is created from JSON or from type implementing CargoCfgProvider
.
This structure provides default values for all fields and can be constructed
by either LoggerConfig::new() or LoggerConfig::default(). Those two calls
are equivalent to each other.Traits
Functions
Uses an implementation of
CargoCfgProvider
to collect a configuration storing structure (CargoConfig
)
which then can be passed to super::cargo_lib::create_cargo_lib
in order to instantiate main API object (super::CargoLib
)Parses bytes representing JSON formatted configuration of
super::CargoLib
into an instance of CargoConfig
The settings
must be a string with JSON formatted configuration.