pub enum SettingKey {
DefaultTimeoutSecs,
AgentDefaultsJsonErrors,
RetryDefaultsMaxAttempts,
RetryDefaultsInitialDelayMs,
RetryDefaultsMaxDelayMs,
}Expand description
Represents a valid configuration setting key.
Each variant maps to a specific path in the configuration file,
with dot-notation used for nested values (e.g., agent_defaults.json_errors).
§Adding a New Setting
When adding a new setting, update the following locations:
- This enum - Add a new variant with doc comment
SettingKey::ALL- Add the variant to the arraySettingKey::as_str()- Return the dot-notation key stringSettingKey::type_name()- Return the type name for displaySettingKey::description()- Return a human-readable descriptionSettingKey::default_value_str()- Return the default value as stringSettingKey::value_from_config()- Extract value fromGlobalConfigFromStr for SettingKey- Parse the key string to variantSettingValue- Add type variant if needed (e.g.,String,Vec)SettingValue::parse_for_key()- Parse string to value with validationConfigManager::set_setting()- Apply value to TOML documentGlobalConfig(models.rs) - Add the field to the config struct- CLI help text (cli.rs) - Update
config setcommand’slong_about - Tests - Add unit and integration tests for the new setting
Variants§
DefaultTimeoutSecs
Default timeout for API requests in seconds (default_timeout_secs)
AgentDefaultsJsonErrors
Whether to output errors as JSON by default (agent_defaults.json_errors)
RetryDefaultsMaxAttempts
Maximum number of retry attempts (retry_defaults.max_attempts)
RetryDefaultsInitialDelayMs
Initial delay between retries in milliseconds (retry_defaults.initial_delay_ms)
RetryDefaultsMaxDelayMs
Maximum delay cap in milliseconds (retry_defaults.max_delay_ms)
Implementations§
Source§impl SettingKey
impl SettingKey
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the dot-notation key string for this setting.
Sourcepub const fn description(&self) -> &'static str
pub const fn description(&self) -> &'static str
Returns a human-readable description of this setting.
Sourcepub const fn default_value_str(&self) -> &'static str
pub const fn default_value_str(&self) -> &'static str
Returns the default value for this setting as a string.
Sourcepub const fn value_from_config(&self, config: &GlobalConfig) -> SettingValue
pub const fn value_from_config(&self, config: &GlobalConfig) -> SettingValue
Extracts the current value for this setting from a GlobalConfig.
Trait Implementations§
Source§impl Clone for SettingKey
impl Clone for SettingKey
Source§fn clone(&self) -> SettingKey
fn clone(&self) -> SettingKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SettingKey
impl Debug for SettingKey
Source§impl Display for SettingKey
impl Display for SettingKey
Source§impl FromStr for SettingKey
impl FromStr for SettingKey
Source§impl Hash for SettingKey
impl Hash for SettingKey
Source§impl PartialEq for SettingKey
impl PartialEq for SettingKey
impl Copy for SettingKey
impl Eq for SettingKey
impl StructuralPartialEq for SettingKey
Auto Trait Implementations§
impl Freeze for SettingKey
impl RefUnwindSafe for SettingKey
impl Send for SettingKey
impl Sync for SettingKey
impl Unpin for SettingKey
impl UnsafeUnpin for SettingKey
impl UnwindSafe for SettingKey
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.