Expand description
Safe, high-level Rust interface to GNU Units.
By default this crate uses a native pure-Rust unit engine.
Build with --no-default-features --features vendored to use the vendored C library instead.
Structs§
- Definition
- A single entry from the GNU units definitions database.
- Unit
- Represents a dimensional quantity: a numeric factor paired with zero or more base dimensions.
- Units
Error - Wraps a raw error code returned by the units engine.
Enums§
- Definition
Kind - The kind of a definition entry in the GNU units database.
- Error
Code - Numeric error codes matching the GNU units C library values.
Functions§
- conformable
- Returns all unit definitions conformable with
exprin alphabetical order. - convert
- Parses
fromandtoas GNU units expressions and returns the numeric conversion factor. - list_
definitions - Returns all unit definitions from the embedded GNU units database, sorted alphabetically.
- parse
- Convenience wrapper around
Unit::parse.
Type Aliases§
- Result
- Convenience alias for
std::result::Result<T, UnitsError>.