[][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

Unit tables

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 ucum crate.

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.