Crate urbandictionary [] [src]

ci-badge license-badge docs-badge

urbandictionary.rs

Unofficial Rust crate for the Urbandictionary API.

Documentation

Installation

Add the following dependency to your Cargo.toml:

urbandictionary = "0.2"

And include it in your project:

extern crate urbandictionary;

Examples

Retrieve a list of definitions for a word:

use urbandictionary::UrbanClient;

let client = UrbanClient::new();
let definitions = client.definitions("cat");

Retrieve the top definition for a word:

use urbandictionary::UrbanClient;

let client = UrbanClient::new();

let definition = client.define("cat");

License

License info in LICENSE.md. Long story short, ISC.

Structs

Definition

A definition and example for a word, including metadata such as the author's name and the definition's rating.

Response

A full response for a word, including the related tags and a list of Definitions.

UrbanClient

A thin wrapper around a hyper Client.

Enums

Error

Common error type used throughout the library, to be used as a holder for errors from various other libraries.

Type Definitions

Result

Common result type used throughout the library.