Expand description
§deepl-rs
Deepl-rs is a simple library for making requests to the DeepL API endpoint easier. And it also provides types wrapping to guarantee runtime safety.
This is still a WORK IN PROGRESS library, please open an issue on GitHub to request features. Be aware breaking changes will be released frequently.
§Usage
use deepl::DeepLApi;
let key = std::env::var("DEEPL_API_KEY").unwrap();
let api = DeepLApi::with(&key).new();
let response = api.translate_text("Hello World", Lang::ZH).await.unwrap();
assert!(!response.translations.is_empty());
See DeepLApi
for detailed usage.
§License
This project is licensed under MIT license.
Re-exports§
pub use reqwest;
Modules§
Macros§
- A self implemented Type Builder
Structs§
- A struct that contains necessary data for runtime. Data is stored in
Arc
, so it is cheap to clone in your App’s code. - The builder struct. DO NOT USE IT IN YOUR APPS
- Response from api/v2/document/$ID
- Information about a supported language
- Response from basic translation API
- Response from api/v2/document
- Response from the usage API
Enums§
- Possible value of the document translate status
- Representing error during interaction with DeepL
- Formality preference for translation
- Languages
- Language type used to request supported languages
- Sets which kind of tags should be handled. Options currently available