1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
//! [![ci-badge][]][ci] [![license-badge][]][license] [![docs-badge][]][docs] [![rust badge]][rust link] //! //! # urbandictionary.rs //! //! Unofficial async Rust client for the Urbandictionary API. //! //! ### Installation //! //! This library requires at least Rust 1.39. //! //! Add the following dependency to your Cargo.toml: //! //! ```toml //! urbandictionary = "0.4.0-alpha.1" //! ``` //! //! ### Examples //! //! Retrieve a list of definitions for a word and print the example of the first //! definition, if it exists: //! //! ```no_run //! use reqwest::Client as HttpClient; //! use urbandictionary::Client; //! //! # #[tokio::main] //! # async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { //! let http_client = HttpClient::new(); //! let client = Client::new(http_client); //! //! let definition = client.define("cat").await?; //! //! if let Some(definition) = definition { //! println!("Examples: {}", definition.example); //! } //! # Ok(()) } //! ``` //! //! [ci-badge]: https://github.com/zeyla/top.gg.rs/workflows/Test/badge.svg //! [ci]: https://github.com/zeyla/top.gg.rs/actions //! [docs-badge]: https://img.shields.io/badge/docs-online-2020ff.svg?style=flat-square //! [docs]: https://docs.rs/top-gg //! [license-badge]: https://img.shields.io/badge/license-ISC-blue.svg?style=flat-square //! [license]: https://opensource.org/licenses/ISC //! [rust badge]: https://img.shields.io/badge/rust-1.39%20(beta)+-93450a.svg?style=flat-square //! [rust link]: https://blog.rust-lang.org/2019/09/30/Async-await-hits-beta.html pub mod error; pub mod model; mod client; pub use client::Client;