pub struct Query<'q> {
pub from: &'q str,
pub to: &'q str,
pub projectid: u8,
pub q: &'q [&'q str],
}Expand description
翻译前的必要信息
https://cloud.tencent.com/document/product/551/40566
Fields§
§from: &'q str翻译源语言,可设置为 auto
TODO:变成 enum 类型
to: &'q str翻译目标语言,不可设置为 auto
TODO:和 from 共用 enum 类型,但是并非任意两个语言之间可以互译。
比如 ar(阿拉伯语):en(英语) 表明阿拉伯语只能从英语中翻译过去。
请求翻译 query,必须为 UTF-8 编码。
TODO: 在传入之前应该把文字控制在 2000 以内, 一个汉字、一个字母、一个标点都计为一个字符, 超过 2000 字节要分段请求。
projectid: u8§q: &'q [&'q str]Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'q> Freeze for Query<'q>
impl<'q> RefUnwindSafe for Query<'q>
impl<'q> Send for Query<'q>
impl<'q> Sync for Query<'q>
impl<'q> Unpin for Query<'q>
impl<'q> UnwindSafe for Query<'q>
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