pub struct TranslationConfig {
pub batch_size: usize,
pub default_target_language: Option<String>,
}Expand description
Subtitle translation configuration parameters.
Controls translation behavior shared by the translate command, the
translation engine, and AI prompt builders. Validation rules ensure
translation requests do not silently degrade to nonsensical values.
§Examples
use subx_cli::config::TranslationConfig;
let cfg = TranslationConfig::default();
assert!(cfg.batch_size > 0);
assert!(cfg.default_target_language.is_none());Fields§
§batch_size: usizeMaximum number of subtitle cues per AI translation request.
Larger batches reduce the number of round-trips but risk hitting per-request token limits. Must be greater than zero.
default_target_language: Option<String>Optional default target language used when the user omits
--target-language on the CLI.
Trait Implementations§
Source§impl Clone for TranslationConfig
impl Clone for TranslationConfig
Source§fn clone(&self) -> TranslationConfig
fn clone(&self) -> TranslationConfig
Returns a duplicate 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 moreSource§impl Debug for TranslationConfig
impl Debug for TranslationConfig
Source§impl Default for TranslationConfig
impl Default for TranslationConfig
Source§impl<'de> Deserialize<'de> for TranslationConfig
impl<'de> Deserialize<'de> for TranslationConfig
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 TranslationConfig
impl RefUnwindSafe for TranslationConfig
impl Send for TranslationConfig
impl Sync for TranslationConfig
impl Unpin for TranslationConfig
impl UnsafeUnpin for TranslationConfig
impl UnwindSafe for TranslationConfig
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