[−][src]Crate ucum
UCUM is the Unified Code for Units of Measure.
This crate is a (partial) implementation of the revision 442 of the UCUM specification.
Quick start
use ucum::prelude::*; let system = UnitSystem::<f64>::default(); let q1 = system.parse("35.5 km/h")?; let q2 = system.parse("1.1e1 m.s-1")?; assert!(q1 < q2); assert!(2*q1 > q2);
Implementation status
Syntax and semantics
- [x] Parser for UCUM complex units
- [x] Semantics of standard units
- [x] Semantics of special units
- [ ] Semantics of arbitrary units
Unit tables
- [x] Table 1: prefix symbols
- [x] Table 2: base units
- [x] Table 3: dimensionless units
- [x] Table 4: SI units
- [x] Table 5: Other units from ISO 1000, ISO 2955, and some from ANSI X3.50
- [ ] Table 6: Natural units
- [ ] Table 7: CGS units
- [ ] Table 8: International customary units
- [ ] Table 9: Older U.S. “survey” lengths (also called "statute" lengths)
- [ ] Table 10: British Imperial lengths
- [ ] Table 11: U.S. volumes including so called “dry measures”
- [ ] Table 12: British Imperial volumes
- [ ] Table 13: Avoirdupois weights
- [ ] Table 14: Troy weights
- [ ] Table 15: Apothecaries' weights
- [ ] Table 16: Units used in typesetting
- [ ] Table 17: Other Units for Heat and Temperature
- [ ] Table 18: Units Used Predominantly in Clinical Medicine
- [ ] Table 19: Units used in Chemical and Biomedical Laboratories
- [ ] Table 20: Levels
- [ ] Table 21: Miscellaneous Units
- [ ] Table 22: Units used in Information Science and Technology
- [ ] Table 23: The special prefix symbols for powers of 2
Misc
- [ ] Full crate documentation
Modules
ast | Abstract Syntax Tree for UCUM units. |
dimension | Representation of the dimension of units and quantities. |
error | Error type for this crate. |
parser | Parser for UCUM units and UCUM quantities (i.e. value + unit). |
prelude | Re-exports most useful symbols from the |
quantity | A Quantity has a magnitude and a dimension. |
special | Special units conversion funcions. See http://unitsofmeasure.org/ucum.html#section-Special-Units-on-non-ratio-Scales |
system | This module initializes the tables of all UCUM units. |