pub struct AnalysisConfig {
pub neo4j: Option<Neo4jConfig>,
}
Expand description
The fully processed and usable configuration for the erpc-analysis
application. It combines settings from the TOML file and environment
variables.
Fields§
§neo4j: Option<Neo4jConfig>
Optional Neo4j configuration. Some
if Neo4j is enabled and
credentials are loaded, None
otherwise.
Implementations§
source§impl AnalysisConfig
impl AnalysisConfig
sourcepub fn load_from_toml_and_env(args: &Args) -> Result<Self>
pub fn load_from_toml_and_env(args: &Args) -> Result<Self>
Loads the application configuration.
This function performs the following steps:
- Reads the TOML configuration file specified by
args.config
. - Parses the TOML into
TomlRootConfig
. - Checks
toml_root.primary.neo4j_allowed
. - If Neo4j is allowed, it attempts to load
NEO4J_DB_ADDR
,NEO4J_DB_USERNAME
, andNEO4J_DB_PASSWORD
from environment variables (expected to be set viaconfig/primary/.env
). - Constructs and returns the final
AnalysisConfig
.
§Arguments
args
- Parsed command-line arguments containing the path to the TOML config file.
§Errors
Returns an error if the TOML file cannot be read or parsed, or if Neo4j is allowed but the required environment variables for credentials are not set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnalysisConfig
impl RefUnwindSafe for AnalysisConfig
impl Send for AnalysisConfig
impl Sync for AnalysisConfig
impl Unpin for AnalysisConfig
impl UnwindSafe for AnalysisConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more