Expand description

Latest Release pipeline status coverage report

Description

Dimension and unit system for general physical quantities.

This package provids the implementations. For general use, unitage is convenient.

When you use this package only for restrict the argument for your function to paticular dimension, it may be prefer adding this package to the dependencies directly.

Usage

use ::physical_quantity::*;

let inch: Unit<f64, _> = "in.".parse().unwrap();
let pq = inch.pq(1f64);
let mm: Unit<f64, _> = "mm".parse().unwrap();
let inch2mm = mm.value(pq).unwrap();

assert_eq!(inch2mm, 25.4);

Features

This package has the following feature flags. No feature flags are enabled by default.

  • full Enables all features.
  • default-units Enables the default definitions of the units. Enabling this flag enables parser flag also.
  • parser Enables the unit string parser.
  • ratio Enables num_rational::BigRational supports.
  • std Enables std supports.

Project status

This package is in the very early stage.

Re-exports

pub use unit::Unit;
pub use unit::Conv;

Modules

Structs

Static (compile time) Dimension.

Dynamic (runtime) Dimension

Represents physical quantity

Traits