anything/lib.rs
1//! [<img alt="github" src="https://img.shields.io/badge/github-udoprog/anything-8da0cb?style=for-the-badge&logo=github" height="20">](https://github.com/udoprog/anything)
2//! [<img alt="crates.io" src="https://img.shields.io/crates/v/anything.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/anything)
3//! [<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-anything-66c2a5?style=for-the-badge&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/anything)
4//!
5//! Calculate everything and nothing with perfect precision.
6//!
7//! Anything provides the `any` binary, which is a small flexible program
8//! intended to do calculations and query for numerical facts.
9//!
10//! You can install the `any` command by using:
11//!
12//! ```sh
13//! cargo install anything
14//! ```
15//!
16//! The `any` command can do a couple of really interesting things:
17//!
18//! * Unit conversions!
19//! * `any 3dl to m^3` gives us `0.0003 m³`.
20//! * `any 1000Gbtu to MWh` gives us `293055.555555555555… hr⋅MW`.
21//! * Fact queries!
22//! * `any population finland / population world` gives us
23//! `0.000710822459005…`.
24//! * Basic math!
25//! * `any 32500 / round(population finland)` gives us `0.00586566578555…`.
26//! * Unit-aware calculations!
27//! * `any 3N / 10kg` gives us `0.3 m/s²`.
28//! * And a bit more...
29//!
30//! You can think of `any` is a **much** smaller and local wolfram engine,
31//! without the hassle of having to go online for your answers.
32
33#![deny(missing_docs)]
34
35mod compound;
36mod config;
37mod db;
38mod error;
39mod eval;
40mod generated;
41mod numeric;
42mod powers;
43mod prefix;
44mod query;
45pub mod rational;
46#[doc(hidden)]
47pub mod syntax;
48mod unit;
49mod unit_parser;
50pub mod units;
51
52pub use self::compound::Compound;
53pub use self::db::{Constant, Db, Source};
54pub use self::error::Error;
55pub use self::numeric::Numeric;
56pub use self::powers::Powers;
57pub use self::query::{parse, query, Description, Options, Query};
58pub use self::rational::Rational;
59pub use self::unit::Unit;