uom
Units of measurement
0.38.0
12M downloads/mo
#2781 most downloaded on crates.io
iliekturtles/uom
What this package is like to depend on
Last release 6 months ago
14 Feb 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 34 of 34 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
34 releases · first in 2017
1 release in the last 12 months
see the full history below
Release timeline
34 releases · Feb 2017 to Feb 2026Releases
latest 34-
0.38.014 Feb 2026Release notes
Open source →This release adds new quantities, new units, compile time improvements, resolves regressions introduced in v0.37.0, and bumps the MSRV (minimum supported Rust version) to 1.68.0.
The release contains a breaking change to remove unnecessary unit struct fields from
Unitsenum variants. Affected code can be updated by removing the unit struct when using the enum.- assert_eq!("km", length::Units::kilometer(kilometer).abbreviation()); + assert_eq!("km", length::Units::kilometer.abbreviation());The next release of
uomwill remove the long deprecateduse_serdefeature. Theserdefeature should be used in it's place.Many thanks to elongatedsquid, gdtroszak, Jonahbell, jschillem, nnethercote, portyanikhin, TheComamba, and Turbo87 for pull requests included and issues resolved in this release.
Added
- #506 Add
CompressibilityCoefficientquantity. - #512 Add
Illuminancequantity. - #524 Add ancient Roman units of
Length,Area,Volume, andMass. - #526 Add
watt_hour_per_square_meterunit toRadiantExposure. - #549 Add
data_mileunit toLength.
Changed
- #544 Increase MSRV (minimum supported Rust
version) to
1.68.0. Newer versions ofserde_jsonrequire the update. - #553 Use
serde_coreinstead ofserde. - #552 [Breaking] Remove unnecessary unit struct
fields from
Unitsenum variants. The unit struct fields were never used beyond construction. - #563 Correct
astronomical_unitprecision.
Fixed
- #521 Fix
unit!macro to be able to be used in foreign crates when running tests. Correct CI tests to run for all targets to detect future regressions. - #533, #536, #537 Improve compile time. v0.38.0 compiles 15 % +/- 1 % faster than v0.37.0 even after the numerous quantity and unit additions. Most improvements involving simplifying macro patterns or call trees.
- #531,
#532,
#534,
#544,
#558 Rust 1.93.0 is now used for
rustfmt,clippy, andtarpaulinjobs. Numerous lint warnings resolved. - #541 Correct
doc_example!to properly run/ignore documentation tests and no longer generate unexpected cfg condition compiler warnings. - #555 Correct conversion factors for
square_mile,square_yard, and derived units. - #557 Consistently place quantity tests in a
testsmodule.
- #506 Add
-
0.37.015 May 2025Release notes
Open source →This release adds new quantities, new units, updates
uomto 2021 edition, and fixes bitrot exposed by the latest tools.Many thanks to aevyrie, boondocklabs, caspermeijn, cutlerjake, elsandosgrande, mkdjr, Netzwerk2, nsunderland1, and portyanikhin for pull requests included and issues resolved in this release.
Added
- #479 Add
AngularMomentumquantity. - #489 Add
ton_long_per_cubic_footandton_short_per_cubic_footunits toMassDensity. - #489 Add numerous units to
SpecificVolume. - #502 Add
inch_per_minuteunit toVelocity. - #507 Add
SurfaceTensionquantity. - #508 Add
KinematicViscosityquantity. - Add
gram_forceunit toForce.
Changed
- #477 Replace relative URLs in documents with Rust item links.
- #516 Rust 1.86.0 is now used for
rustfmt,clippy, andtarpaulinjobs. - #514 Update to 2021 edition.
- Automatically check unit validity by replacing explicit
TypeIdchecks withConversion::is_validcalls.
Fixed
- #462 Fix abbreviations for units in
MassPerEnergy. - #473 Fix abbreviations for units in
InverseVelocity. - #478 Fix NIST Special Publication 811 links.
- #500 Resolve
unexpected_cfgwarnings caused bycfgreferences in macro-generated code. - Correct
cargo-clippy/clippyfeature usage for--check-cfg. - Resolve
clippyempty docs warnings.
Release notes
Open source →This release adds new quantities, new units, updates
uomto 2021 edition, and fixes bitrot exposed by the latest tools.Many thanks to aevyrie, boondocklabs, caspermeijn, cutlerjake, elsandosgrande, mkdjr, Netzwerk2, nsunderland1, and portyanikhin for pull requests included and issues resolved in this release.
Added
- #479 Add
AngularMomentumquantity. - #489 Add
ton_long_per_cubic_footandton_short_per_cubic_footunits toMassDensity. - #489 Add numerous units to
SpecificVolume. - #502 Add
inch_per_minuteunit toVelocity. - #507 Add
SurfaceTensionquantity. - #508 Add
KinematicViscosityquantity. - Add
gram_forceunit toForce.
Changed
- #477 Replace relative URLs in documents with Rust item links.
- #516 Rust 1.86.0 is now used for
rustfmt,clippy, andtarpaulinjobs. - #514 Update to 2021 edition.
- Automatically check unit validity by replacing explicit
TypeIdchecks withConversion::is_validcalls.
Fixed
- #462 Fix abbreviations for units in
MassPerEnergy. - #473 Fix abbreviations for units in
InverseVelocity. - #478 Fix NIST Special Publication 811 links.
- #500 Resolve
unexpected_cfgwarnings caused bycfgreferences in macro-generated code. - Correct
cargo-clippy/clippyfeature usage for--check-cfg. - Resolve
clippyempty docs warnings.
- #479 Add
-
0.36.021 Mar 2024Release notes
Open source →This release adds new quantities, new units, bumps the MSRV (minimum supported Rust version) to 1.65.0, and fixes bitrot in Github actions.
Many thanks to Aehmlo, Code-Maniac, baarkerlounger, g1aeder, hellow554, igiona, waywardmonkeys, and yacinelakel for pull requests included and issues resolved in this release.
Added
- #429 Add
minute_per_kilometerunit toInverseVelocity. - #436 Add explicit
serdefeature. The newserdefeature deprecates the olduse_serdefeature which is now an alias forserdeand will be removed in a futureuomrelease. - #446 Add
ArealHeatCapacityquantity. - #450 Add
ThermalResistancequantity.
Changed
- #425 Clarify
Conversiondocumentation for converting to and from the base unit. - #432 Use
Cargo.tomlrust-versionkey to identify the MSRV (minimum supported Rust version). - #445 Update basic example with example code to do unit conversions.
- #456 Commit
Cargo.lockto pin certain crates to specific versions that supportuom's MSRV (minimum supported Rust version). - #459 Increase MSRV (minimum supported Rust version) to
1.65.0. No changes in this release require the new MSRV. - #457 Update github
checkoutandcacheactions tov4. - #459 Rust 1.76.0 is now used for
rustfmt,clippy, andtarpaulinjobs. - #443, #459 Resolve numerous
rustcandclippywarnings.
Release notes
Open source →This release adds new quantities, new units, bumps the MSRV (minimum supported Rust version) to 1.65.0, and fixes bitrot in Github actions.
Many thanks to Aehmlo, Code-Maniac, baarkerlounger, g1aeder, hellow554, igiona, waywardmonkeys, and yacinelakel for pull requests included and issues resolved in this release.
Added
- #429 Add
minute_per_kilometerunit toInverseVelocity. - #436 Add explicit
serdefeature. The newserdefeature deprecates the olduse_serdefeature which is now an alias forserdeand will be removed in a futureuomrelease. - #446 Add
ArealHeatCapacityquantity. - #450 Add
ThermalResistancequantity.
Changed
- #425 Clarify
Conversiondocumentation for converting to and from the base unit. - #432 Use
Cargo.tomlrust-versionkey to identify the MSRV (minimum supported Rust version). - #445 Update basic example with example code to do unit conversions.
- #456 Commit
Cargo.lockto pin certain crates to specific versions that supportuom's MSRV (minimum supported Rust version). - #459 Increase MSRV (minimum supported Rust
version) to
1.65.0. No changes in this release require the new MSRV. - #457 Update github
checkoutandcacheactions tov4. - #459 Rust 1.76.0 is now used for
rustfmt,clippy, andtarpaulinjobs. - #443,
#459 Resolve numerous
rustcandclippywarnings.
- #429 Add
-
0.35.010 Jul 2023Release notes
Open source →This release adds new quantities, bumps the MSRV (minimum supported Rust version) to 1.60.0, and
fixes bitrot in Github actions.Many thanks to calbaker, groscoe2, professoralex13, robinohs, and Uzaaft for pull requests included and issues resolved in this release.
Added
- #406 Add
cubic_meter_per_minuteandcubic_meter_per_hourunits toVolumeRate. - #409 Add
AngularAbsementquantity. - #410 Add
MassPerEnergyquantity. - #417 [Breaking] Correct
ThermalConductancemeter_perunits to bemeter_squared_per. Descriptions and abbreviations were already correct. - #419 Add
PowerRatequantity. - #420 Add
InverseVelocityquantity.
Changed
- #314 Update Github actions to use
dtolnay/rust-toolchain.actions-rsis no longer maintained. - #387 Increase MSRV (minimum supported Rust version) to
1.60.0. No changes in this release require the new MSRV.
Fixed
- Fix unnecessary qualifications warnings in quantity tests.
Release notes
Open source →This release adds new quantities, bumps the MSRV (minimum supported Rust version) to 1.60.0, and fixes bitrot in Github actions.
Many thanks to calbaker, groscoe2, professoralex13, robinohs, and Uzaaft for pull requests included and issues resolved in this release.
Added
- #406 Add
cubic_meter_per_minuteandcubic_meter_per_hourunits toVolumeRate. - #409 Add
AngularAbsementquantity. - #410 Add
MassPerEnergyquantity. - #417 [Breaking] Correct
ThermalConductancemeter_perunits to bemeter_squared_per. Descriptions and abbreviations were already correct. - #419 Add
PowerRatequantity. - #420 Add
InverseVelocityquantity.
Changed
- #314 Update Github actions to use
dtolnay/rust-toolchain.actions-rsis no longer maintained. - #387 Increase MSRV (minimum supported Rust
version) to
1.60.0. No changes in this release require the new MSRV.
Fixed
- Fix unnecessary qualifications warnings in quantity tests.
- #406 Add
-
0.34.010 Feb 2023Release notes
Open source →This release adds a significant number of new quantities and units as well as a few minor fixes.
Many thanks to adamreichold, calbaker, Eagle941, jossriLDR, swaits, Uzaaft werdahias, and zdimension for pull requests included and issues resolved in this release. Special thanks to crystal-growth for the thirty nine pull requests included in this release.
Added
- #318 Add
particleunits toAmountOfSubstance,CatalyticActivity,CatalyticActivityConcentration,MolarConcentration,MolarEnergy, andMolarHeatCapacityquantities. - #319 Add
MolarFluxquantity. - #322 Add
DiffusionCoefficientquantity. - #323 Add
DynamicViscosityquantity. - #324 Add atomic units of energy, mass, length, electric charge, and current.
- #325 Add
Actionquantity. - #326 Add
ElectricFieldquantity. - #327 Add
ElectricDipoleMomentandElectricQuadrupoleMomentquantities. - #329 Add
ElectricalMobilityquantity. - #330 Add
ElectricalResistivityquantity. - #331 Add
ElectricalConductivityquantity. - #332 Add
ElectricPermittivityquantity. - #333 Add
ElectricCurrentDensityquantity. - #334 Add
ArealNumberDensity,LinearNumberDensity, andVolumetricNumberDensityquantities. - #335 Add
ReciprocalLengthquantity. - #336 Add
MassFluxquantity. - #337 Add
MagneticPermeabilityquantity. - #339 Add
ArealNumberRate,LinearNumberRate, andVolumetricNumberRatequantities. - #341 Add
ArealMassDensity,LinearMassDensity, andVolumetricMassDensityquantities. - #342 Add
SurfaceElectricCurrentDensityquantity. - #343 Add
MagneticMomentquantity. - #344 Add
ElectricChargeArealDensity,ElectricChargeLinearDensity, andElectricChargeVolumetricDensityquantities. - #345 Add
ElectricDisplacementFieldquantity. - #346 Add
MagneticFieldStrengthquantity. - #347 Add
MolarVolumequantity. - #348 Add
ElectricFluxquantity. - #349 Add
TemperatureGradientquantity. - #350 Add
LinearPowerDensityandVolumetricPowerDensityquantities as well as additionalHeatFluxDensityunits. - #351 Add
standard_gravityunit toAcceleration. - #352 Add
SpecificAreaandSpecificVolumequantities. - #353 Add
boltzmann_constantunit toHeatCapacityandmolar_gas_constantunit toMolarHeatCapacity. - #354 Add
TemperatureCoefficientquantity. - #355 Add
ArealDensityOfStates,LinearDensityOfStates, andVolumetricDensityOfStatesquantities. - #356 Add
MomentOfInertiaquantity. - #358 Add molar flow rate units to
AmountOfSubstanceandCatalyticActivity. - #361 Add
atomic_unit_of_velocity,natural_unit_of_velocityandspeed_of_light_in_vacuumunits toVelocity. - #368 Add quantities for
Radioactivity,MolarRadioactivity, andSpecificRadioactivityas well as additionalVolumetricNumberRateunits. - #369 Add
VolumetricHeatCapacityquantity as well as additionalHeatCapacityandSpecificHeatCapacityunits. - #370 Add
Molalityquantity. - #388 Add
FrequencyDriftquantity. - #396 Add
SpecificPowerquantity. - #399 Add
liter per minuteunit toVolumeRateandnewton per square millimeterunit toPressure. - #405 Add
ton_per_minute,ton_per_hour, andton_per_dayunits toMassRate. - #408 Add
ThermalConductancequantity.
Fixed
Release notes
Open source →This release adds a significant number of new quantities and units as well as a few minor fixes.
Many thanks to adamreichold, calbaker, Eagle941, jossriLDR, swaits, Uzaaft werdahias, and zdimension for pull requests included and issues resolved in this release. Special thanks to crystal-growth for the thirty nine pull requests included in this release.
Added
- #318 Add
particleunits toAmountOfSubstance,CatalyticActivity,CatalyticActivityConcentration,MolarConcentration,MolarEnergy, andMolarHeatCapacityquantities. - #319 Add
MolarFluxquantity. - #322 Add
DiffusionCoefficientquantity. - #323 Add
DynamicViscosityquantity. - #324 Add atomic units of energy, mass, length, electric charge, and current.
- #325 Add
Actionquantity. - #326 Add
ElectricFieldquantity. - #327 Add
ElectricDipoleMomentandElectricQuadrupoleMomentquantities. - #329 Add
ElectricalMobilityquantity. - #330 Add
ElectricalResistivityquantity. - #331 Add
ElectricalConductivityquantity. - #332 Add
ElectricPermittivityquantity. - #333 Add
ElectricCurrentDensityquantity. - #334 Add
ArealNumberDensity,LinearNumberDensity, andVolumetricNumberDensityquantities. - #335 Add
ReciprocalLengthquantity. - #336 Add
MassFluxquantity. - #337 Add
MagneticPermeabilityquantity. - #339 Add
ArealNumberRate,LinearNumberRate, andVolumetricNumberRatequantities. - #341 Add
ArealMassDensity,LinearMassDensity, andVolumetricMassDensityquantities. - #342 Add
SurfaceElectricCurrentDensityquantity. - #343 Add
MagneticMomentquantity. - #344 Add
ElectricChargeArealDensity,ElectricChargeLinearDensity, andElectricChargeVolumetricDensityquantities. - #345 Add
ElectricDisplacementFieldquantity. - #346 Add
MagneticFieldStrengthquantity. - #347 Add
MolarVolumequantity. - #348 Add
ElectricFluxquantity. - #349 Add
TemperatureGradientquantity. - #350 Add
LinearPowerDensityandVolumetricPowerDensityquantities as well as additionalHeatFluxDensityunits. - #351 Add
standard_gravityunit toAcceleration. - #352 Add
SpecificAreaandSpecificVolumequantities. - #353 Add
boltzmann_constantunit toHeatCapacityandmolar_gas_constantunit toMolarHeatCapacity. - #354 Add
TemperatureCoefficientquantity. - #355 Add
ArealDensityOfStates,LinearDensityOfStates, andVolumetricDensityOfStatesquantities. - #356 Add
MomentOfInertiaquantity. - #358 Add molar flow rate units to
AmountOfSubstanceandCatalyticActivity. - #361 Add
atomic_unit_of_velocity,natural_unit_of_velocityandspeed_of_light_in_vacuumunits toVelocity. - #368 Add quantities for
Radioactivity,MolarRadioactivity, andSpecificRadioactivityas well as additionalVolumetricNumberRateunits. - #369 Add
VolumetricHeatCapacityquantity as well as additionalHeatCapacityandSpecificHeatCapacityunits. - #370 Add
Molalityquantity. - #388 Add
FrequencyDriftquantity. - #396 Add
SpecificPowerquantity. - #399 Add
liter per minuteunit toVolumeRateandnewton per square millimeterunit toPressure. - #405 Add
ton_per_minute,ton_per_hour, andton_per_dayunits toMassRate. - #408 Add
ThermalConductancequantity.
Fixed
- #318 Add
-
0.33.028 Jun 2022Release notes
Open source →This release adds one new quantity,
Absement. Two new underlying storage types,Complex32andComplex64. Eight new exponential and logarithmic functions onRatioand changes to use#[must_use]and#[non_exhaustive].Many thanks to adamreichold, gonzaponte, jacg, nick-pascucci-spire, and TobTobXX for pull requests included and issues resolved in this release.
Added
- #284, #285
Absementquantity added. - #287 Add support for
Complex32andComplex64as underlying storage types. - #290 Implement
exp2,exp_m1,exp,ln_1p,ln,log10,log2, andlogforRatio. - #306 Add missing
#[must_use]on all methods returning a value.must_use_candidateandreturn_self_not_must_useclippy lints are now enabled to ensure future methods include the attribute.
Changed
- #272 Improve documentation on how to enable
serdeforbig*andrational*underlying storage types. - Enable
#[non_exhaustive]onUnitsenums. The#[doc(hidden)] __nonexhaustivetrick is not longer used.
Release notes
Open source →This release adds one new quantity,
Absement. Two new underlying storage types,Complex32andComplex64. Eight new exponential and logarithmic functions onRatioand changes to use#[must_use]and#[non_exhaustive].Many thanks to adamreichold, gonzaponte, jacg, nick-pascucci-spire, and TobTobXX for pull requests included and issues resolved in this release.
Added
- #284,
#285
Absementquantity added. - #287 Add support for
Complex32andComplex64as underlying storage types. - #290 Implement
exp2,exp_m1,exp,ln_1p,ln,log10,log2, andlogforRatio. - #306 Add missing
#[must_use]on all methods returning a value.must_use_candidateandreturn_self_not_must_useclippy lints are now enabled to ensure future methods include the attribute.
Changed
- #272 Improve documentation on how to enable
serdeforbig*andrational*underlying storage types. - Enable
#[non_exhaustive]onUnitsenums. The#[doc(hidden)] __nonexhaustivetrick is not longer used.
- #284, #285
-
0.32.014 Jan 2022Release notes
Open source →This release adds one new quantity,
MolarHeatCapacity, a new trait,ConstZero, and many internal improvements. Thequickcheck1.0 update uncovered a number of issues with floating point precision that were able to be resolved while still maintaining zero-cost guarantees.Many thanks to adamreichold, B-Reif, remilauzier, and T-Bakker for pull requests included and issues resolved in this release.
Added
Changed
- #258 Use
RUSTFLAGS="-D warnings"in CI to ensure thatrustcwarnings and caught and fail their respective workflows. - [Breaking] Rename
Conversion::into_conversiontoConversion::conversion. Name change resolvesClippywrong_self_conventionwarnings. - #260 Increase minimum supported
rustcversion to 1.43.0. Required to supportquickcheck1.0. - #260 Update to
quickcheck1.0. Change required the MSRV update as well as refactoringfrom_base,to_base, and multiple tests. Thefrom_baseandto_basechanges provide better floating point precision while still maintaining zero-cost guarantees. The test changes better handle floating point precision issues as well as the wider range of values generated byquickcheck1.0'sArbitraryimplementation. - #268 Clarify
powidocumentation.
Deprecated
- #260 Deprecate
try-fromfeature. The feature will be removed in a future release ofuom. Functionality previously exposed by the feature is now enabled by default.
Fixed
Release notes
Open source →This release adds one new quantity,
MolarHeatCapacity, a new trait,ConstZero, and many internal improvements. Thequickcheck1.0 update uncovered a number of issues with floating point precision that were able to be resolved while still maintaining zero-cost guarantees.Many thanks to adamreichold, B-Reif, remilauzier, and T-Bakker for pull requests included and issues resolved in this release.
Added
Changed
- #258 Use
RUSTFLAGS="-D warnings"in CI to ensure thatrustcwarnings and caught and fail their respective workflows. - [Breaking] Rename
Conversion::into_conversiontoConversion::conversion. Name change resolvesClippywrong_self_conventionwarnings. - #260 Increase minimum supported
rustcversion to 1.43.0. Required to supportquickcheck1.0. - #260 Update to
quickcheck1.0. Change required the MSRV update as well as refactoringfrom_base,to_base, and multiple tests. Thefrom_baseandto_basechanges provide better floating point precision while still maintaining zero-cost guarantees. The test changes better handle floating point precision issues as well as the wider range of values generated byquickcheck1.0'sArbitraryimplementation. - #268 Clarify
powidocumentation.
Deprecated
- #260 Deprecate
try-fromfeature. The feature will be removed in a future release ofuom. Functionality previously exposed by the feature is now enabled by default.
Fixed
- #258 Use
-
0.31.101 Mar 2021Release notes
Open source →This release corrects documentation issues and documents fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded.
Added
- #241 Run
rustdocas part of tool checks and resolve previously ignored warnings.
Changed
- #241 Document fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded. Previous releases documented all features and caused documentation to fail to build.
Release notes
Open source →This release corrects documentation issues and documents fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded.
Added
- #241 Run
rustdocas part of tool checks and resolve previously ignored warnings.
Changed
- #241 Document fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded. Previous releases documented all features and caused documentation to fail to build.
- #241 Run
-
0.31.005 Jan 2021Release notes
Open source →This release adds a new macro,
unit!, to allow for units to be defined outside of thequantity!macro as well as aUnitsenum for each quantity. A number of standard library traits are implemented. Build regressions caused by issues with the CI system and changes in Rust are now fixed.Many thanks to bheisler, CreepySkeleton, DusterTheFirst, Lucretiel, and neoeinstein for pull requests included and issues resolved in this release.
Added
- #173 Allow new units to be defined using
unit!outside ofquantity!. When using the pre-built SI system included withuomthis macro allows for new units to quickly be defined without requiring a release. Pull requests to add new units upstream area always greatly appreciated. - #215 Add
Unitsenum andfn units() -> impl Iterator<Item = Units>function for each quantity. - #227 Ensure
UnwindSafeandRefUnwindSafeare implemented. - #217 Add trait implementations for
DisplayandErrortoParseQuantityError.
Changed
- #214 The
FromStrimplementation for quantities now supports the unit singular and plural descriptions in addition to the unit abbreviation. - #225 Convert CI to use Github Actions. This change fixes a number of problems with the old system and greatly improves build times.
- #223 Correct build regressions introduced while no test job was run with the old CI system.
Release notes
Open source →This release adds a new macro,
unit!, to allow for units to be defined outside of thequantity!macro as well as aUnitsenum for each quantity. A number of standard library traits are implemented. Build regressions caused by issues with the CI system and changes in Rust are now fixed.Many thanks to bheisler, CreepySkeleton, DusterTheFirst, Lucretiel, and neoeinstein for pull requests included and issues resolved in this release.
Added
- #173 Allow new units to be defined using
unit!outside ofquantity!. When using the pre-built SI system included withuomthis macro allows for new units to quickly be defined without requiring a release. Pull requests to add new units upstream area always greatly appreciated. - #215 Add
Unitsenum andfn units() -> impl Iterator<Item = Units>function for each quantity. - #227 Ensure
UnwindSafeandRefUnwindSafeare implemented. - #217 Add trait implementations for
DisplayandErrortoParseQuantityError.
Changed
- #214 The
FromStrimplementation for quantities now supports the unit singular and plural descriptions in addition to the unit abbreviation. - #225 Convert CI to use Github Actions. This change fixes a number of problems with the old system and greatly improves build times.
- #223 Correct build regressions introduced while no test job was run with the old CI system.
- #173 Allow new units to be defined using
-
0.30.018 Oct 2020Release notes
Open source →This release adds a new quantity,
RadiantExposure, implementsUnpinforQuantityand upgradesuomto the 2018 edition. These changes also include an increase of the minimum supportedrustcto 1.37.0. Many thanks to nicodemus26 and (Michael-F-Bryan)[https://github.com/Michael-F-Bryan] for pull requests included and issues resolved in this release.Added
Changed
Release notes
Open source →This release adds a new quantity,
RadiantExposure, implementsUnpinforQuantityand upgradesuomto the 2018 edition. These changes also include an increase of the minimum supportedrustcto 1.37.0. Many thanks to nicodemus26 and (Michael-F-Bryan)[https://github.com/Michael-F-Bryan] for pull requests included and issues resolved in this release.Added
Changed
-
0.29.007 Aug 2020Release notes
Open source →This release includes a number of changes for
Angle, the addition ofSolidAngle, and a new units forEnergyandLuminance. Many thanks to adamreichold, AnickaBurova, and Atmelfan for pull requests included and issues resolved in this release.Added
- #196
SolidAnglequantity added. - #191 Add constants to
AngleandSolidAnglerepresenting half and full turns. - #194 Add
foot-candleunit toLuminance. - #200
electronvolt-basedEnergyunits added.
Changed
- #192 Use
f{32|64}::powiinstead ofTypenum::Pow::powi. - #123 Change examples to use
Displayinstead ofDebug.
Removed
- #188 [Breaking] Remove
From/Intoimpls forAngleandSolidAngle.
- #196
-
0.28.021 May 2020Release notes
Open source →This release includes a number of trigonometric improvements as well as new units for
Time. Many thanks to adamreichold and Aehmlo for pull requests included and issues resolved in this release.Added
- #182 Add inverse trigonometric functions to
Ratio(acos,acosh,asin,asinh,atan,atanh) andAngle(atan2). - #184 Tropical and sidereal units added to
Time.
Changed
- #182 Add inverse trigonometric functions to
-
0.27.014 Feb 2020 -
0.26.004 Nov 2019Release notes
Open source →This release adds a number of thermodynamic quantities in addition to
TryFromimplementations forTimeand trigonometric functions onAngle.Added
- #164
HeatFluxDensityquantity added. - #155
HeatCapacity,HeatTransfer,MolarEnergy,MolarMass,SpecificHeatCapacity,ThermalConductivityquantities added. - #150
TryFromimplemented betweenstd::time::Durationanduom::si::Time. - #151 Trigonometric functions added to
Angle.
Changed
- Increase minimum supported
rustcversion to 1.31.0. Required to because of backwards incompatibilities withCargo.tomleditionkeyword.cfg-ifintroducted the keyword in a minor version update and other issues with the keyword prompted the update.
- #164
-
0.25.013 Aug 2019Release notes
Open source →This release includes the long-requested
InformationandInformationRatequantities as well as support fori128/u128as underlying storage types. A number of documentation updates, including for the 9th edition of the SI, are also included.Added
- #31
Information(bit,byte, ...) andInformationRate(bit/s,byte/s, ...) quantities added. Units for both SI (kilo,mega, ...) and binary (kibi,mebi, ...) prefixes are included. - #85 Add support for
i128andu128as underlying storage types. - #160
AngularJerkquantity added.
Changed
- #31
-
0.24.020 Jun 2019Release notes
Open source →This release fixes two separate issues to ensure that zero-cost code is generated. Many thanks to raimundomartins, apopiak, and gnzlbg for pull requests included and issues resolved in this release.
Added
- #145 Add
#[repr(transparent)]toQuantityto ensure that the ABI of the underlying storage type is used instead of struct ABI in FFI contexts.
Changed
- #148 Increase minimum supported
rustcversion to 1.28.0. Required to support#[repr(transparent)].
Fixed
- #145 Add
-
0.23.129 May 2019Release notes
Open source →This release fixes an issue with the
autoconvertfeature introduced in [v0.23.0]. Many thanks to dmit for pull requests included in this release.Fixed
- #141
Fromimplementations to convert between quantities of different kinds now correctly use theautoconvertfeature and no longer cause a compile error when the feature is disabled.
- #141
-
0.23.013 May 2019Release notes
Open source →This release adds three new quantities,
AngularAcceleration,AngularVelocity, andTorque. Changes to makeKinds more ergonomic to use are also included along with documentation changes. Many thanks to dunmatt and Aehmlo for pull requests included in this release.Added
- #136
AngularAccelerationquantity added. - #135
AngularVelocityquantity added. - #117
Torquequantity added. - Introduce
AngleKindandsi::markerto hold SI specific marker traits.Fromimplementations forAngleKindadded to more easily convert betweenuom::Kindandsi::marker::AngleKind. - Allow documentation to be specified for base quantities in the
system!macro. Documentation for the seven base SI quantities added.
Changed
- #138 Maintain kind when multiplying a number by a quantity. Multiplying a quantity by a number already maintains kind.
- #130 Rename
DensitytoMassDensity. A type alias forDensityis available for backwards compatibility. - #127 Make all SI quantity documentation follow a single, consistent format.
Deprecated
- #130
Densityhas been renamed toMassDensityand is deprecated.Densitywill be removed in some future release.
- #136
-
0.22.228 Apr 2019Release notes
Open source →This release adds
AngleandJerkquantities along with unit additions and conversion precision improvements toAccelerationandVelocity. Many thanks to dunmatt and nicodemus26 respectively.Added
- #89
Anglequantity added. - #128
Jerkquantity added.AccelerationandVelocityunits added and precision for some existing units improved.
Changed
- Continuous integration setup updated and improved.
- Rust 1.34.0 is now used for
rustfmt,clippy, andtarpaulinjobs. rustfmtconfiguration updated.clippyconfiguration corrected to run for all packages.
- Rust 1.34.0 is now used for
- #89
-
0.22.103 Apr 2019Release notes
Open source →This release adds additional
liter-basedVolumeRateunits.Added
- #121
Liter-basedVolumeRateunits added.
- #121
-
0.22.031 Mar 2019Release notes
Open source →This release adds the
Momentumquantity and additionalliter-basedvolumeunits.Added
Changed
- Continuous integration setup updated and improved.
- Rust 1.33.0 is now used for
rustfmt,clippy, andtarpaulinjobs. - The deny warnings job is joined into the
clippyjob. - The stable + tests job has been updated to catch errors with non-default underlying storage types in SI quantity tests.
- Rust 1.33.0 is now used for
Fixed
- #119 Macros corrected to generate valid code
for both 2015 and 2018 editions. Previously the doc test on the
$quantities!macro would fail in a Rust 2018 crate. A new test crate,edition_check, was added to ensureuomremains usable in Rust 2018 code.
- Continuous integration setup updated and improved.
-
0.21.103 Mar 2019Release notes
Open source →This release adds a few new units for
ElectricChargeandEnergy.Added
- #112 Additional
ElectricChargeandEnergyunits added.
- #112 Additional
-
0.21.014 Jan 2019Release notes
Open source →This release adds display tools for quantities resolving another long-standing issue, #13.
Added
- #13 Add display tools for quantities. Allows
Quantityto be formatted with the standard library formatting traits:Binary,Debug,Display,LowerExp,LowerHex,Octal,UpperExp,UpperHex.
Changed
- Improve continuous integration setup.
- Update
clippyandrustfmtjobs to use the now stable non-previewcomponents. - Run OSX and Windows builds on TravisCI.
- Improve individual job build time by reducing unnecessary cached data.
- Update
- #13 Add display tools for quantities. Allows
-
0.20.116 Sep 2018Release notes
Open source →This release resolves nightly rustc error E0659 the base.rs example caused by rust-lang/rust pull request #52841 "resolve: Implement prelude search for macro paths, implement tool attributes."
-
0.20.007 Sep 2018Release notes
Open source →This release resolves long-standing issue #3 to implement thermodynamic temperature conversions (e.g. Celsius to Fahrenheit). Support is also added for multiple quantities of the same dimension (e.g. thermodynamic temperature and temperature interval, ratio and angle).
The release also contains a number of internal changes including a reorganization of tests into multiple files and updated CI setup to provide faster builds and more feature test coverage.
Added
- #3 Implement thermodynamic temperature
conversions (e.g. Celsius to Fahrenheit). Extend the
quantity!macro to accept a coefficient and optional constant factor in the$conversionparameter to support these conversions. - #14 Implement
FromStr. - #78 Add a
Kindassociated type toDimensions.The newKindassociated type, defaulting touom::Kind, allows for multiple quantities that have the same dimensions. Quantities of different kinds are not comparable. The marker traits implemented by a quantity'sKindcontrol which operations are automatically implemented. - #95
TemperatureIntervalquantity added. IncludesAdd,AddAssign,Sub, andSubAssignimplementations between thermodynamic temperature and temperature interval.
Changed
- [Breaking] Remove unused
_unit: Nparameters and require turbofish syntax forget,floor,ceil,round,trunc, andfractmethods ofQuantity. This is a breaking change and can easily be resolved. e.g.l.get(meter)becomesl.get::<meter>(). - #98,
#100 Correct
uomfeature hygiene in macro generated code. Previously thesystem!macro generated code that included#[cfg(feature = "...")]attributes on code in the crate executing thesystem!macro. With this fix these attributes will be eagerly evaluated and only generate code when the appropriateuomfeature is enabled. - Spelling corrections for a number of documentation comments and unit abbreviations.
- #3 Implement thermodynamic temperature
conversions (e.g. Celsius to Fahrenheit). Extend the
-
0.19.021 Jun 2018Release notes
Open source →This release adds a number of additional quantities, configures
uomto userustfmt, and directly referencesnumsub-crates to better control feature selection.Added
Capacitancequantity added.ElectricChargequantity added.ElectricalConductancequantity added.ElectricalResistancequantity added.Inductancequantity added.Luminancequantity added.MagneticFluxDensityquantity added.MagneticFluxquantity added.
Changed
- #57
numsub-cratesnum-traits,num-rational, andnum-bigintare now directly referenced to control feature selection.std,rational, andbigintsupport are only included based onuomfeature selection. - #80 Setup
rustfmtso thatuomcode can be automatically formatted and builds are gated on changes not breaking formatting conventions.
-
0.18.012 May 2018Release notes
Open source →This release contains a significant number of new quantities and units, compile time improvements, and a few bug fixes. See below for full details. Many thanks to Aehmlo for all of the new quantities and units. radix for the
autoconvertfeature. Nemo157 for hygiene fixes in thestorage_types!macro.Added
- #54 [Breaking] Add an
autoconvertfeature, enabled by default, which allows for operations between quantities with different base units.autoconvertenabled is the same functionality as prior versions ofuom. Disabling the feature only allows for quantities with the same base units to directly interact. The feature has been added to account for current compiler limitations where zero-cost code is not generated for non-floating point underlying storage types. With the feature disabled more optimal code will be generated for integral types. This feature will likely have no effect and subsequently be deprecated and removed onceconst fnand specialization are stabilized. - #61 [Breaking] The
storage_types!macro now always uses underlying storage type features from theuomcrate instead of the crate where the macro is executed. - #2 Additional
Massunits added. - #5 Additional
Velocityunits added. - #6 Additional
Areaunits added. - #7 Additional
Volumeunits added. - #8 Additional
Forceunits added. - #9 Additional
Accelerationunits added. - #30 Additional
Frequencyunits added. - #64
Ratio(dimensionless) quantity added. IncludesFrom<Ratio> for VandFrom<V> for Ratioimplementations to allow for easy conversions betweenRatioand the underlying storage type. - #66
Energyquantity added. - #67
AvailableEnergyquantity added. - #68
Densityquantity added. - #69
Powerquantity added. - #70
Pressurequantity added. - #71
MassRatequantity added. - #72
VolumeRatequantity added. - #74
ElectricPotentialquantity added. - #75 Additional
ElectricCurrentunits added.
Changed
- #52 Type aliases generated by the
storage_type!macro are now public. e.g.pub type V = f32;. This change drastically reduces compile times, especially when multiple underlying storage types are enabled. - Dimension documentation for
ElectricCurrentcorrected to no longer referencesAmountOfSubstanceand units smaller thanmilliamperehave corrected abbreviations and descriptions.
Removed
- #15 [Breaking] Remove
Productimplementation forQuantity. The product of a quantity is not that same quantity. e.g.Length * Length = Area.
- #54 [Breaking] Add an
-
0.17.014 Mar 2018Release notes
Open source →This release implements a number of common traits from the standard library, the
numcrate, and theserdecrate.Added
- #16 Implement
Default. - #17 Implement
PartialEq. - #50 Implement
Eq. - #18 Implement
PartialOrd. - #51 Implement
Ord. - #56 Implement
Sum. - #15 Implement
Product. - #26 Implement
num::Zero. - #35 Implement
num::Saturating. - #37 Implement
serde::Serializeandserde::Deserialize. Disabled by default. Enabled with theuse_serdefeature.
- #16 Implement
-
0.16.021 Dec 2017Release notes
Open source →This release contains significant changes in order to support underlying storage types that implement the
Numtrait beyondf32andf64. Many changes are breaking: marker traits are simplified and fewer macros are exported. New storage types are not enabled by default and can be used by including the corresponding feature. See the changes below for full details.Added
- Add missing
#[derive(Hash)]attributes. - #29 A new macro,
storage_types!, is now available to duplicate code on a per-storage type basis. See macro documentation for full details. The minimum supportedrustcversion is now 1.20.0.
Changed
- #29 Underlying storage type now uses the
Numtrait from thenumcrate instead of fixed implementations forf32andf64. Features for all types implementingNumhave been added and control the availability of the type as an underlying storage type:usize,u8,u16,u32,u64,isize,i8,i16,i32,i64,bigint,biguint,rational,rational32,rational64,bigrational,f32, andf64. For compile time reasons onlyf32andf64are enabled by default. Tests are implemented for all underlying storage types but don't account for minimum or maximum values and will fail for non-float types where the conversion factor overflows the type's limits. A future release will correct this. - #29 [Breaking] Traits and structs generated by
the
system!macro have been significantly changed in order to support non-float underlying storage types.Dimensionchanged to directly include associated types for quantity dimensions.Units<V>is now only parameterized onVand contains associated types for base units.Conversion<V>has been removed and replaced withuom::Conversion<V>.$quantities<...>has been removed. Quantity dimensions are now directly in theDimensiontrait.BaseUnits<...>has been removed. Base units are not directly in theUnits<V>trait.uom::Conversion<V>added to replaceConversion<V>and gives access to a unit's conversion factor.uom::ConversionFactor<V>added to represent conversion factors for underlying storage types where the type can't be used (e.g.i32's conversion factor is represented asRational32.)
- [Breaking] Macro usage and definitions have been simplified and consolidated.
quantities!,replace_ty!, andunit!have been consolidated as "private" match arms of their calling macro. In order to reduce the chance of macro name collisions$quantities!is the only remaining generated exported macro (e.g.ISQ!for thesisystem). Generated macros for each quantity no longer exist. These changes make it easier to have multiple systems containing quantities with the same names. In order to support this change quantities in theunitsblock of thesystem!macro must always be prefixed by the quantity's module (e.g.length::Length). Prefixing the module with themodkeyword instructs thesystem!macro not to generate a#[macro_use] pub mod $module;statement.
- Add missing
-
0.15.005 Jul 2017Release notes
Open source →This release adds additional
Timeunits;Frequency,Force, andVolumequantities; and numerous floating point methods such asmin,max, andpowi.Added
- #4 Additional
Timeunits added. - Add missing
gigaunits. e.g.gigameter. - #11 Add floating point classification methods
classify,is_finite,is_infinte,is_nan, andis_normalforQuantity. - #11 Add floating point fractional methods
floor,ceil,round,trunc, andfractforQuantity. - #11 Add floating point comparison methods
maxandminforQuantity. - #11 Add floating point
mul_addmethod forQuantity. - #11 Add floating point
powimethod forQuantity. - #7
Volumequantity added. Additional units still need to be added. - #8
Forcequantity added. Additional units still need to be added. - #30
Frequencyquantity added. Additional units still need to be added.
- #4 Additional
-
0.14.030 May 2017Release notes
Open source →Added
- [Breaking] A new feature,
std, is now available and is enabled by default.uomcan still be compiled withno_stdby using--no-default-featureswhen compiling the crate ordefault-features = falsein thedependenciessection ofCargo.toml - #11
cbrt,recip, andsqrtare implemented forQuantity.
Changed
- #28
Quantityfields made public in order to allow library users to createconstvalues and instances of non-named quantities. e.g.const TIME_STEP: Time = Quantity { dimension: PhantomData, units: PhantomData, value: 0.1 };This functionality will be deprecated and subsequently removed once theconst fnfeature is stabilized. - Tests now run for all enabled underlying storage types (
f32,f64).
Fixed
- Fixed incorrect conversion factor when multiplying or dividing
Quantitys with different base units.
- [Breaking] A new feature,
-
0.13.020 Apr 2017Release notes
Open source →This release adds numerous tests both for code generated by the
quantity!,system!, and$quantities!macros as well as derived quantities. Fixes for issues found during testing noted below. Quantity implementations forAreaandAccelerationalso added.Added
- #6
Areaquantity added. Additional units still need to be added. - #9
Accelerationquantity added. Additional units still need to be added.
Changed
- [Breaking] Remove the unused
_unitparameter fromQuantity::newand so summon the turbofish. e.g.Length::new(1.0, meter)becomesLength::new::<meter>(1.0). - #22 Change
impl DebugforQuantityto use precision information. Previously the implementation checked thealternateflag which has no affect on printing raw floats. - #27 Change superscripts in documentation to the
format supported by
pulldownin anticipation of upcommingrustdocchanges.
Fixed
- #22 Fix
impl SubforQuantityto be implemented in terms of-instead of+.
- #6
-
0.12.001 Apr 2017Release notes
Open source →Continuous integration was setup to ensure that
uombuilds on stable, beta, nightly, and 1.15.0 (the minimumrustcversion). Quantity descriptions, unit abbreviations, and unit descriptions added. Additional length units added to demonstrate the simplicity of the process.Added
- #1 Additional
Lengthunits added. - [Breaking] The
quantity!macro accepts comments on units. To resolve macro parsing ambiguities each unit must be prefixed with an@. - #19 [Breaking] The
quantity!macro includes the quantity description. The description can be accessed using thedescription()method in quantity submodules. - #19 [Breaking] The
quantity!macro includes unit abbreviations as well as singular and plural descriptions. These values can be accessed from newabbreviation(),singular(), andplural()methods on theUnittrait. The originalUnit<V>trait has been renamedConversion<V>. - #12
Debugmanually implemented forQuantity<D, U, V>to show the underlying value and associated units. - Test and compile-fail test modules setup. compile-fail tests for mismatched quantities and units added.
- #1 Additional
-
0.11.026 Feb 2017Release notes
Open source →Proof-of-concept functionality for type-safe zero-cost dimensional analysis.
uom[0.11.0] allows for the creation of custom systems or the use of the pre-built SI. Basic mathematical operations are implemented and a minimal set of quantities (length, mass, time...) and units (meter, kilometer, foot, mile, ...) are included.