wow_items/
lib.rs

1//! `wow_items`
2//!
3//! Crate containing item definitions for World of Warcraft versions 1.12.x (`vanilla`), 2.4.3.8606 (`tbc`), and 3.3.5.x (`wrath`).
4//!
5//! ## Usage
6//!
7//! Add the crate with the required features:
8//!
9//! ```bash
10//! cargo add --features 'vanilla tbc wrath' wow_items
11//! ```
12//!
13//! Each expansion module contains an [`all_items`](vanilla::all_items) function that returns a slice to all items
14//! and a [`lookup_item`](vanilla::lookup_item) function that searches all available items.
15//! Prefer [`lookup_item`](vanilla::lookup_item) over manually searching [`all_items`](vanilla::all_items).
16//!
17//! ```rust
18//! let item_id = 12640; // Lionheart Helm
19//!
20//! # #[cfg(feature = "vanilla")]
21//! if let Some(item) = wow_items::vanilla::lookup_item(item_id) {
22//!     println!("Lionheart has {} strength and {} agility.", item.strength(), item.agility());
23//! } else {
24//!     println!("Item not found.");
25//! }
26//! ```
27//!
28//! ## Notice
29//!
30//! This crate contains very large constant arrays which can cause out-of-memory errors during compilation.
31//! Try reducing the amount of cores used for compilation if this is the case.
32//!
33//! ## Auto Generation
34//!
35//! This crate is partially auto generated through sqlite databases in the
36//! [`wow_messages` repository](https://github.com/gtker/wow_messages/).
37//!
38#![cfg_attr(docsrs, feature(doc_auto_cfg))]
39#![cfg_attr(docsrs, feature(doc_cfg))]
40
41/// Version 2.4.3.8606.
42#[cfg(feature = "tbc")]
43pub mod tbc;
44/// Version 1.12.x.
45#[cfg(feature = "vanilla")]
46pub mod vanilla;
47/// Version 3.3.5.x.
48#[cfg(feature = "wrath")]
49pub mod wrath;