pub struct AnalysisConfig {
pub neo4j: Option<Neo4jConfig>,
pub analysis_params: AnalysisParametersConfig,
}
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.
analysis_params: AnalysisParametersConfig
Analysis-specific parameters for algorithms and settings
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§
source§impl Clone for AnalysisConfig
impl Clone for AnalysisConfig
source§fn clone(&self) -> AnalysisConfig
fn clone(&self) -> AnalysisConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)