pub struct DeepLTranslator { /* private fields */ }Expand description
Translator backend that calls the DeepL /v2/translate endpoint.
Supports both the free tier (https://api-free.deepl.com) and the pro tier
(https://api.deepl.com). The default base URL targets the free tier.
§Example
use psyche_subtitle_toolkit::DeepLTranslator;
let translator = DeepLTranslator::new("your-api-key")?;
// let result = translator.translate(request).await?;Implementations§
Trait Implementations§
Source§impl Clone for DeepLTranslator
impl Clone for DeepLTranslator
Source§fn clone(&self) -> DeepLTranslator
fn clone(&self) -> DeepLTranslator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeepLTranslator
impl Debug for DeepLTranslator
Source§impl Translator for DeepLTranslator
impl Translator for DeepLTranslator
Source§fn translate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: TranslationRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn translate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: TranslationRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Translate the source text and return the translated string. Read more
Auto Trait Implementations§
impl Freeze for DeepLTranslator
impl !RefUnwindSafe for DeepLTranslator
impl Send for DeepLTranslator
impl Sync for DeepLTranslator
impl Unpin for DeepLTranslator
impl UnsafeUnpin for DeepLTranslator
impl !UnwindSafe for DeepLTranslator
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