[−][src]Struct deepl_api::DeepL
The main API entry point representing a DeepL developer account with an associated API key.
Example
See Example.
Error Handling
None of the functions will panic. Instead, the API methods usually return a Result
If you get an AuthorizationError, then something was wrong with your API key, for example.
Implementations
impl DeepL
[src]
Implements the actual REST API. See also the online documentation.
pub fn new(api_key: String) -> DeepL
[src]
Use this to create a new DeepL API client instance where multiple function calls can be performed.
A valid api_key
is required.
Should you ever need to use more than one DeepL account in our program, then you can create one instance for each account / API key.
pub fn usage_information(&self) -> Result<UsageInformation>
[src]
Retrieve information about API usage & limits. This can also be used to verify an API key without consuming translation contingent.
See also the vendor documentation.
pub fn source_languages(&self) -> Result<LanguageList>
[src]
Retrieve all currently available source languages.
See also the vendor documentation.
pub fn target_languages(&self) -> Result<LanguageList>
[src]
Retrieve all currently available target languages.
See also the vendor documentation.
pub fn translate(
&self,
options: Option<TranslationOptions>,
text_list: TranslatableTextList
) -> Result<Vec<TranslatedText>>
[src]
&self,
options: Option<TranslationOptions>,
text_list: TranslatableTextList
) -> Result<Vec<TranslatedText>>
Translate one or more text chunks at once. You can pass in optional translation flags if you need non-default behaviour.
Please see the parameter documentation and the vendor documentation for details.
Auto Trait Implementations
impl RefUnwindSafe for DeepL
[src]
impl Send for DeepL
[src]
impl Sync for DeepL
[src]
impl Unpin for DeepL
[src]
impl UnwindSafe for DeepL
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,