Skip to main content

Crate gnu_units

Crate gnu_units 

Source
Expand description

Safe, high-level Rust interface to GNU Units.

Provides unit parsing, conversion, and definition listing backed by the vendored C library exposed through gnu_units_sys.

Re-exports§

pub use gnu_units_sys;

Structs§

Definition
A single entry from the GNU units definitions database.
Unit
Unit wraps a GNU units unittype for safe use from Rust.
UnitsError
UnitsError wraps a raw error code returned by the GNU units C library.

Enums§

DefinitionKind
The kind of a definition entry in the GNU units database.

Functions§

conformable
Finds all unit definitions that are conformable with expr.
convert
Parses from and to as GNU units expressions and returns the numeric conversion factor from from to to.
list_definitions
Returns all unit definitions from the embedded GNU units database.
parse
Convenience free function, equivalent to Unit::parse.

Type Aliases§

Result
Convenience alias for std::result::Result<T, UnitsError>.