pub struct TranslationConfigBuilder {
config: TranslationConfig,
}Expand description
配置构建器
Fields§
§config: TranslationConfigImplementations§
Source§impl TranslationConfigBuilder
impl TranslationConfigBuilder
Sourcepub fn target_language(self, lang: &str) -> Self
pub fn target_language(self, lang: &str) -> Self
设置目标语言
Sourcepub fn with_cache(self, ttl: Duration, max_entries: usize) -> Self
pub fn with_cache(self, ttl: Duration, max_entries: usize) -> Self
启用缓存
Sourcepub fn with_batching(self, size: usize, use_indexing: bool) -> Self
pub fn with_batching(self, size: usize, use_indexing: bool) -> Self
设置批处理配置
Sourcepub fn with_retry(self, max_retries: usize, delay_ms: u64) -> Self
pub fn with_retry(self, max_retries: usize, delay_ms: u64) -> Self
设置重试配置
Sourcepub fn build(self) -> TranslationResult<TranslationConfig>
pub fn build(self) -> TranslationResult<TranslationConfig>
构建配置
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TranslationConfigBuilder
impl RefUnwindSafe for TranslationConfigBuilder
impl Send for TranslationConfigBuilder
impl Sync for TranslationConfigBuilder
impl Unpin for TranslationConfigBuilder
impl UnwindSafe for TranslationConfigBuilder
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