pub struct Config {
pub base_url: String,
pub proxy: Option<String>,
}
Expand description
Configuration settings for the DeepLX
translation client.
§Examples
§Using Default Configuration
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config::default());
§Custom Base URL
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config {
base_url: "https://custom.deepl.api/jsonrpc".to_string(),
..Default::default()
});
§Configuring a Proxy (Requires proxy
Feature)
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config {
proxy: Some("http://pro.xy".to_string()),
..Default::default()
});
Fields§
§base_url: String
§proxy: Option<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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