Expand description
Unit conversion at the API boundary.
All internal computation uses canonical units (mils for length, Hz for frequency, etc.). These types and functions convert user-facing values to/from internal representation.
The newtype wrappers (Length, Freq, etc.) implement FromStr to parse
strings like "0.254mm" or "1GHz", converting to canonical units on construction.
Structs§
- Capacitance
- A capacitance value stored in canonical Farads.
- Freq
- A frequency value stored in canonical Hz.
- Inductance
- An inductance value stored in canonical Henries.
- Length
- A length value stored in canonical mils.
- Temperature
- A temperature value stored in canonical Celsius.
Enums§
- CapUnit
- Capacitance units for display.
- Freq
Unit - Frequency units accepted at the API boundary.
- IndUnit
- Inductance units for display.
- Length
Unit - Length units accepted at the API boundary.
- ResUnit
- Resistance units for display.
- Temp
Unit - Temperature units.
- Unit
Parse Error - Error returned when parsing a unit-annotated value from a string.
Functions§
- from_
celsius - Convert from Celsius to user units.
- from_
farads - Convert from Farads to user units.
- from_
henries - Convert from Henries to user units.
- from_hz
- Convert from Hz to user units.
- from_
mils - Convert from mils to user units.
- to_
celsius - Convert to Celsius (internal canonical unit).
- to_
farads - Convert from user units to Farads (internal canonical unit).
- to_
henries - Convert from user units to Henries (internal canonical unit).
- to_hz
- Convert from user units to Hz (internal canonical unit).
- to_mils
- Convert from user units to mils (internal canonical unit).