pub struct Config {
pub ai: AIConfig,
pub formats: FormatsConfig,
pub sync: SyncConfig,
pub general: GeneralConfig,
pub parallel: ParallelConfig,
pub loaded_from: Option<PathBuf>,
}
Expand description
Full application configuration for SubX.
This struct aggregates all settings for AI integration, subtitle format conversion, synchronization, general options, and parallel execution.
§Examples
use subx_cli::config::Config;
let config = Config::default();
assert_eq!(config.ai.provider, "openai");
assert_eq!(config.formats.default_output, "srt");
§Serialization
This struct can be serialized to/from TOML format for configuration files.
use subx_cli::config::Config;
let config = Config::default();
let toml_str = toml::to_string(&config)?;
assert!(toml_str.contains("[ai]"));
Fields§
§ai: AIConfig
AI service configuration parameters.
formats: FormatsConfig
Subtitle format conversion settings.
sync: SyncConfig
Audio-subtitle synchronization options.
general: GeneralConfig
General runtime options (e.g., backup enabled, job limits).
parallel: ParallelConfig
Parallel processing parameters.
loaded_from: Option<PathBuf>
Optional file path from which the configuration was loaded.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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