Skip to main content

Crate rustuse

Crate rustuse 

Source
Expand description

§rustuse

Unified facade crate for the published RustUse sets and child crates.

rustuse gives one dependency surface that exposes the current RustUse sets on main:

  • constants primitives from use-constants
  • chemistry primitives from use-chemistry
  • math primitives from use-math
  • Rust ecosystem primitives from use-rust

The crate re-exports every concrete child crate directly at the top level and also groups them by set so consumers can choose the style they prefer.

§Installation

[dependencies]
rustuse = "0"

Disable default features if you only want one set:

[dependencies]
rustuse = { version = "0", default-features = false, features = ["constants"] }

§Usage

§Access child crates directly

use rustuse::use_earth_constants::EARTH_RADIUS_MEAN;
use rustuse::use_math_constants::TAU;
use rustuse::use_element::element_by_symbol;
use rustuse::use_combinatorics::factorial;
use rustuse::use_version::parse_version;

let oxygen = element_by_symbol("O").unwrap();
let count = factorial(5).unwrap();
let version = parse_version("0.1.0").unwrap();

assert!(EARTH_RADIUS_MEAN > 0.0);
assert_eq!(TAU, 2.0 * std::f64::consts::PI);
assert_eq!(oxygen.atomic_number, 8);
assert_eq!(count, 120);
assert_eq!(version.to_string(), "0.1.0");

§Access crates through set modules

use rustuse::constants::earth;
use rustuse::constants::math;
use rustuse::chemistry::element::element_by_symbol;
use rustuse::math::combinatorics::factorial;
use rustuse::rust::version::next_minor;

let radius = earth::EARTH_RADIUS_MEAN;
let oxygen = element_by_symbol("O").unwrap();
let count = factorial(5).unwrap();
let version = next_minor(&rustuse::rust::version::parse_version("0.1.0").unwrap());
let circumference = math::TAU * 3.0;

assert!(radius > 0.0);
assert!(circumference > 0.0);
assert_eq!(oxygen.atomic_number, 8);
assert_eq!(count, 120);
assert_eq!(version.to_string(), "0.2.0");

§Set modules

  • rustuse::constants groups use-constants and the focused constants child crates
  • rustuse::chemistry groups use-chemistry and the published chemistry child crates
  • rustuse::math groups use-math and all published use-math child crates
  • rustuse::rust groups use-rust, use-crate, and use-version

§Release scope

The published rustuse 0.1.2 release covers chemistry, constants, math, and rust. The constants surface includes the focused crates from use-constants, including use-earth-constants, once those crates are live on crates.io and the use-constants umbrella crate has been published.

§License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0, in LICENSE-APACHE
  • MIT license, in LICENSE-MIT Thin facade re-exports for the available RustUse crate sets.

Re-exports§

pub use use_astronomical_constants;
pub use use_chemical_constants;
pub use use_computing_constants;
pub use use_constants;
pub use use_earth_constants;
pub use use_math_constants;
pub use use_physical_constants;
pub use use_atomic_mass;
pub use use_atomic_number;
pub use use_chemistry;
pub use use_electron_shell;
pub use use_element;
pub use use_periodic_table;
pub use use_algebra;
pub use use_calculus;
pub use use_catalan;
pub use use_combinatorics;
pub use use_complex;
pub use use_geometry;
pub use use_integer;
pub use use_linear;
pub use use_logic;
pub use use_math;
pub use use_number;
pub use use_probability;
pub use use_rational;
pub use use_real;
pub use use_series;
pub use use_set;
pub use use_statistics;
pub use use_trigonometry;
pub use use_crate;
pub use use_rust;
pub use use_version;

Modules§

chemistry
Grouped access to the RustUse chemistry crates.
constants
Grouped access to the RustUse constants crates.
math
Grouped access to the RustUse math crates.
prelude
Commonly used facade items from set crates that already define a prelude.
rust
Grouped access to the RustUse Rust ecosystem crates.