| Crates.io | deeplx |
| lib.rs | deeplx |
| version | 2.2.4 |
| created_at | 2024-12-05 15:47:25.579422+00 |
| updated_at | 2025-09-14 15:43:07.553158+00 |
| description | A Rust package for unlimited DeepL translation |
| homepage | |
| repository | https://github.com/hominsu/deeplx-rs |
| max_upload_size | |
| id | 1473318 |
| size | 170,926 |
A Rust package for unlimited DeepL translation
Features
·
Usage
·
Integration
·
Reference
·
License
git clone https://github.com/hominsu/deeplx-rs.git
cd deploy
docker-compose up -d
cargo install
Add deeplx to your Cargo.toml:
[dependencies]
deeplx = { version = "2", default-features = false }
deeplx is configured via the Config struct. You can specify options such as proxy, timeout, and more. For example:
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config {
proxy: Some("http://pro.xy".to_string()),
..Default::default()
});
Or you can simply omit the proxy field:
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config::default ());
Below is an example using tokio for async execution:
use deeplx::{Config, DeepLX};
#[tokio::main]
async fn main() {
let translator = DeepLX::new(Config {
proxy: Some("http://pro.xy".to_string()),
..Default::default()
});
// Or without proxy:
// let translator = DeepLX::new(Config::default());
match translator.translate("auto", "zh", "Hello, world!", None).await {
Ok(res) => println!("Translated: {}", res.data),
Err(e) => eprintln!("Error: {}", e),
}
}
Distributed under the MIT License. See LICENSE for more information.