pub struct UnifiedConfig {
pub general: GeneralConfig,
pub ccs: CcsConfig,
pub agents: HashMap<String, AgentConfigToml>,
pub ccs_aliases: CcsAliases,
pub agent_chain: Option<FallbackConfig>,
}Expand description
Unified configuration file structure.
This is the sole source of truth for Ralph configuration,
located at ~/.config/ralph-workflow.toml.
Fields§
§general: GeneralConfigGeneral settings.
ccs: CcsConfigCCS defaults for aliases.
agents: HashMap<String, AgentConfigToml>Agent definitions (used via serde deserialization for future expansion).
ccs_aliases: CcsAliasesCCS alias mappings.
agent_chain: Option<FallbackConfig>Agent chain configuration.
When omitted, Ralph uses built-in defaults.
Implementations§
Source§impl UnifiedConfig
impl UnifiedConfig
Sourcepub fn load_default() -> Option<Self>
pub fn load_default() -> Option<Self>
Load unified configuration from the default path.
Returns None if the file doesn’t exist.
Sourcepub fn load_with_env(env: &dyn ConfigEnvironment) -> Option<Self>
pub fn load_with_env(env: &dyn ConfigEnvironment) -> Option<Self>
Load unified configuration using a [ConfigEnvironment].
This is the testable version of [load_default]. It reads from the
unified config path as determined by the environment.
Returns None if no config path is available or the file doesn’t exist.
Sourcepub fn load_from_path(path: &Path) -> Result<Self, ConfigLoadError>
pub fn load_from_path(path: &Path) -> Result<Self, ConfigLoadError>
Load unified configuration from a specific path.
Note: This method uses std::fs directly. For testable code,
use [load_from_path_with_env] with a [ConfigEnvironment] instead.
Sourcepub fn load_from_path_with_env(
path: &Path,
env: &dyn ConfigEnvironment,
) -> Result<Self, ConfigLoadError>
pub fn load_from_path_with_env( path: &Path, env: &dyn ConfigEnvironment, ) -> Result<Self, ConfigLoadError>
Load unified configuration from a specific path using a [ConfigEnvironment].
This is the testable version of [load_from_path].
Sourcepub fn ensure_config_exists() -> Result<ConfigInitResult>
pub fn ensure_config_exists() -> Result<ConfigInitResult>
Ensure unified config file exists, creating it from template if needed.
This creates ~/.config/ralph-workflow.toml with the default template
if it doesn’t already exist.
Sourcepub fn ensure_config_exists_with_env(
env: &dyn ConfigEnvironment,
) -> Result<ConfigInitResult>
pub fn ensure_config_exists_with_env( env: &dyn ConfigEnvironment, ) -> Result<ConfigInitResult>
Ensure unified config file exists using a [ConfigEnvironment].
This is the testable version of [ensure_config_exists].
Sourcepub fn ensure_config_exists_at(path: &Path) -> Result<ConfigInitResult>
pub fn ensure_config_exists_at(path: &Path) -> Result<ConfigInitResult>
Ensure a config file exists at the specified path.
Sourcepub fn ensure_config_exists_at_with_env(
path: &Path,
env: &dyn ConfigEnvironment,
) -> Result<ConfigInitResult>
pub fn ensure_config_exists_at_with_env( path: &Path, env: &dyn ConfigEnvironment, ) -> Result<ConfigInitResult>
Ensure a config file exists at the specified path using a [ConfigEnvironment].
This is the testable version of [ensure_config_exists_at].
Trait Implementations§
Source§impl Clone for UnifiedConfig
impl Clone for UnifiedConfig
Source§fn clone(&self) -> UnifiedConfig
fn clone(&self) -> UnifiedConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UnifiedConfig
impl Debug for UnifiedConfig
Source§impl Default for UnifiedConfig
impl Default for UnifiedConfig
Source§fn default() -> UnifiedConfig
fn default() -> UnifiedConfig
Source§impl<'de> Deserialize<'de> for UnifiedConfigwhere
UnifiedConfig: Default,
impl<'de> Deserialize<'de> for UnifiedConfigwhere
UnifiedConfig: Default,
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>,
Auto Trait Implementations§
impl Freeze for UnifiedConfig
impl RefUnwindSafe for UnifiedConfig
impl Send for UnifiedConfig
impl Sync for UnifiedConfig
impl Unpin for UnifiedConfig
impl UnwindSafe for UnifiedConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more