pub struct AppConfig {
pub discovery: DiscoveryConfig,
pub analysis: AnalysisConfig,
pub reporting: ReportingConfig,
pub web: WebConfig,
pub git: GitConfig,
pub profiles: BTreeMap<String, ProfileConfig>,
}Fields§
§discovery: DiscoveryConfig§analysis: AnalysisConfig§reporting: ReportingConfig§web: WebConfig§git: GitConfigNon-secret git integration settings (offline-import gate). See GitConfig.
profiles: BTreeMap<String, ProfileConfig>Named profiles that override base config sections when selected via --profile.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn apply_git_settings_to_env(&self)
pub fn apply_git_settings_to_env(&self)
Apply the [git] offline-import settings to the process environment so sloc-git
(which reads SLOC_GIT_ALLOW_LOCAL / SLOC_GIT_LOCAL_ROOT directly) picks them up.
An explicit environment variable always wins: a config value is only applied when the corresponding env var is unset. Call this once, early at startup, before any git op and before spawning worker threads.
Sourcepub fn load_from_file(path: &Path) -> Result<Self>
pub fn load_from_file(path: &Path) -> Result<Self>
§Errors
Returns an error if the file cannot be read, the TOML cannot be parsed, or the resulting config fails validation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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