ytr

Crates.ioytr
lib.rsytr
version0.1.2
sourcesrc
created_at2018-10-07 18:10:58.489102
updated_at2019-07-21 13:28:58.688874
descriptionYandex.Translate API wrapper for Rust
homepage
repositoryhttps://github.com/ilunev/ytr
max_upload_size
id88569
size21,446
(ilunev)

documentation

README

ytr

Yandex.Translate API wrapper for Rust

Usage example

let key = String::from("my-api-key");
let api = ytr::ApiClient::new(key);

let result = api.translate("Hello!", "ru")   // required parameters
    .format("plain")                         // optional parameter
    .get();                                  // execute the request
 
match result {
    Ok(response) => {
        println!("{}", response.text);       // prints "Привет!"
        println!("{}", response.lang);       // prints "en-ru"
    },
     
    Err(error) => {
        eprintln!(
            "An error has occurred: {:?}",
            error
        );
    },
};

License

Licensed under MIT license

Contribution

You are free to propose changes and contribute. Any input is welcome =)

Commit count: 31

cargo fmt