pub struct TranslationConfig {
pub enabled: bool,
pub source_lang: String,
pub target_lang: String,
pub deeplx_api_url: String,
pub max_requests_per_second: f64,
pub max_text_length: usize,
pub max_paragraphs_per_request: usize,
}Expand description
翻译配置
包含翻译服务的所有配置选项,如API地址、语言设置、性能参数等。
§字段说明
enabled- 是否启用翻译功能source_lang- 源语言代码,“auto“表示自动检测target_lang- 目标语言代码deeplx_api_url- DeepLX API地址max_requests_per_second- 每秒最大请求数max_text_length- 单次翻译的最大文本长度max_paragraphs_per_request- 单次请求的最大段落数
Fields§
§enabled: bool是否启用翻译功能
source_lang: String源语言代码,“auto“表示自动检测
target_lang: String目标语言代码
deeplx_api_url: StringDeepLX API地址
max_requests_per_second: f64每秒最大请求数
max_text_length: usize单次翻译的最大文本长度
max_paragraphs_per_request: usize单次请求的最大段落数
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 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