Units of measurement -- type-safe zero-cost dimensional analysis
APACHE-2.0 License
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.
minute_per_kilometer
unit to InverseVelocity
.serde
feature. The new serde
feature deprecates the old use_serde
feature which is now an alias for serde
and will be removed in a future uom
release.ArealHeatCapacity
quantity.ThermalResistance
quantity.Conversion
documentation for converting to and from the base unit.Cargo.toml
rust-version
key to identify the MSRV (minimum supported Rust version).Cargo.lock
to pin certain crates to specific versions that support uom
's MSRV (minimum supported Rust version).1.65.0
. No changes in this release require the new MSRV.checkout
and cache
actions to v4
.rustfmt
, clippy
, and tarpaulin
jobs.rustc
and clippy
warnings.Published by iliekturtles over 1 year ago
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.
cubic_meter_per_minute
and cubic_meter_per_hour
units to VolumeRate
.AngularAbsement
quantity.MassPerEnergy
quantity.ThermalConductance
meter_per
units to be meter_squared_per
. Descriptions and abbreviations were already correct.PowerRate
quantity.InverseVelocity
quantity.dtolnay/rust-toolchain
. actions-rs
is no longer maintained.1.60.0
. No changes in this release require the new MSRV.Published by iliekturtles over 1 year ago
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.
particle
units to AmountOfSubstance
, CatalyticActivity
, CatalyticActivityConcentration
, MolarConcentration
, MolarEnergy
, and MolarHeatCapacity
quantities.MolarFlux
quantity.DiffusionCoefficient
quantity.DynamicViscosity
quantity.Action
quantity.ElectricField
quantity.ElectricDipoleMoment
and ElectricQuadrupoleMoment
quantities.ElectricalMobility
quantity.ElectricalResistivity
quantity.ElectricalConductivity
quantity.ElectricPermittivity
quantity.ElectricCurrentDensity
quantity.ArealNumberDensity
, LinearNumberDensity
, and VolumetricNumberDensity
quantities.ReciprocalLength
quantity.MassFlux
quantity.MagneticPermeability
quantity.ArealNumberRate
, LinearNumberRate
, and VolumetricNumberRate
quantities.ArealMassDensity
, LinearMassDensity
, and VolumetricMassDensity
quantities.SurfaceElectricCurrentDensity
quantity.MagneticMoment
quantity.ElectricChargeArealDensity
, ElectricChargeLinearDensity
, and ElectricChargeVolumetricDensity
quantities.ElectricDisplacementField
quantity.MagneticFieldStrength
quantity.MolarVolume
quantity.ElectricFlux
quantity.TemperatureGradient
quantity.LinearPowerDensity
and VolumetricPowerDensity
quantities as well as additional HeatFluxDensity
units.standard_gravity
unit to Acceleration
.SpecificArea
and SpecificVolume
quantities.boltzmann_constant
unit to HeatCapacity
and molar_gas_constant
unit to MolarHeatCapacity
.TemperatureCoefficient
quantity.ArealDensityOfStates
, LinearDensityOfStates
, and VolumetricDensityOfStates
quantities.MomentOfInertia
quantity.AmountOfSubstance
and CatalyticActivity
.atomic_unit_of_velocity
, natural_unit_of_velocity
and speed_of_light_in_vacuum
units to Velocity
.Radioactivity
, MolarRadioactivity
, and SpecificRadioactivity
as well as additional VolumetricNumberRate
units.VolumetricHeatCapacity
quantity as well as additional HeatCapacity
and SpecificHeatCapacity
units.Molality
quantity.FrequencyDrift
quantity.SpecificPower
quantity.liter per minute
unit to VolumeRate
and newton per square millimeter
unit to Pressure
.ton_per_minute
, ton_per_hour
, and ton_per_day
units to MassRate
.ThermalConductance
quantity.Published by iliekturtles over 2 years ago
This release adds one new quantity, Absement
. Two new underlying storage types, Complex32
and Complex64
. Eight new exponential and logarithmic functions on Ratio
and 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.
Absement
quantity added.Complex32
and Complex64
as underlying storage types.exp2
, exp_m1
, exp
, ln_1p
, ln
, log10
, log2
, and log
for Ratio
.#[must_use]
on all methods returning a value. must_use_candidate
and return_self_not_must_use
clippy lints are now enabled to ensure future methods include the attribute.serde
for big*
and rational*
underlying storage types.#[non_exhaustive]
on Units
enum
s. The #[doc(hidden)] __nonexhaustive
trick is not longer used.Published by iliekturtles almost 3 years ago
This release adds one new quantity, MolarHeatCapacity
, a new trait, ConstZero
, and many internal improvements. The quickcheck
1.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.
RUSTFLAGS="-D warnings"
in CI to ensure that rustc
warnings and caught and fail their respective workflows.Conversion::into_conversion
to Conversion::conversion
. Name change resolves Clippy
wrong_self_convention
warnings.rustc
version to 1.43.0. Required to support quickcheck
1.0.quickcheck
1.0. Change required the MSRV update as well as refactoring from_base
, to_base
, and multiple tests. The from_base
and to_base
changes 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 by quickcheck
1.0's Arbitrary
implementation.powi
documentation.try-from
feature. The feature will be removed in a future release of uom
. Functionality previously exposed by the feature is now enabled by default.Published by iliekturtles over 3 years ago
This release corrects documentation issues and documents fewer underlying storage types on docs.rs so that container time and memory limits are not exceeded.
rustdoc
as part of tool checks and resolve previously ignored warnings.Published by iliekturtles almost 4 years ago
This release adds a new macro, unit!
, to allow for units to be defined outside of the quantity!
macro as well as a Units
enum 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.
unit!
outside of quantity!
. When using the pre-built SI system included with uom
this macro allows for new units to quickly be defined without requiring a release. Pull requests to add new units upstream area always greatly appreciated.Units
enum and fn units() -> impl Iterator<Item = Units>
function for each quantity.UnwindSafe
and RefUnwindSafe
are implemented.Display
and Error
to ParseQuantityError
.FromStr
implementation for quantities now supports the unit singular and plural descriptions in addition to the unit abbreviation.Published by iliekturtles about 4 years ago
This release adds a new quantity, RadiantExposure
, implements Unpin
for Quantity
and upgrades uom
to the 2018 edition. These changes also include an increase of the minimum supported rustc
to 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.
Published by iliekturtles about 4 years ago
This release includes a number of changes for Angle
, the addition of SolidAngle
, and a new units for Energy
and Luminance
. Many thanks to adamreichold, AnickaBurova, and Atmelfan for pull requests included and issues resolved in this release.
SolidAngle
quantity added.Angle
and SolidAngle
representing half and full turns.foot-candle
unit to Luminance
.electronvolt
-based Energy
units added.f{32|64}::powi
instead of Typenum::Pow::powi
.Display
instead of Debug
.From
/Into
impls for Angle
and SolidAngle
.This release adds a number of thermodynamic quantities in addition to TryFrom
implementations for Time
and trigonometric functions on Angle
.
HeatFluxDensity
quantity added.HeatCapacity
, HeatTransfer
, MolarEnergy
, MolarMass
, SpecificHeatCapacity
, ThermalConductivity
quantities added.TryFrom
implemented between std::time::Duration
and uom::si::Time
.Angle
.rustc
version to 1.31.0. Required to because of backwards incompatibilities with Cargo.toml
edition
keyword. cfg-if
introducted the keyword in a minor version update and other issues with the keyword prompted the update.Published by iliekturtles over 4 years ago
This request 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.
Ratio
(acos
, acosh
, asin
, asinh
, atan
, atanh
) and Angle
(atan2
).Time
.Published by iliekturtles about 5 years ago
This release includes the long-requested Information
and InformationRate
quantities as well as support for i128
/u128
as underlying storage types. A number of documentation updates, including for the 9th edition of the SI, are also included.
Information
(bit
, byte
, ...) and InformationRate
(bit/s
, byte/s
, ...) quantities added. Units for both SI (kilo
, mega
, ...) and binary (kibi
, mebi
, ...) prefixes are included.i128
and u128
as underlying storage types.AngularJerk
quantity added.Published by iliekturtles over 5 years ago
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.
#[repr(transparent)]
to Quantity
to ensure that the ABI of the underlying storage type is used instead of struct ABI in FFI contexts.rustc
version to 1.28.0. Required to support #[repr(transparent)]
.This release fixes an issue with the autoconvert
feature introduced in v0.23.0. Many thanks to dmit for pull requests included in this release.
From
implementations to convert between quantities of different kinds now correctly use the autoconvert
feature and no longer cause a compile error when the feature is disabled.Published by iliekturtles over 5 years ago
This release adds three new quantities, AngularAcceleration
, AngularVelocity
, and Torque
. Changes to make Kind
s more ergonomic to use are also included along with documentation changes. Many thanks to dunmatt and Aehmlo for pull requests included in this release.
AngularAcceleration
quantity added.AngularVelocity
quantity added.Torque
quantity added.AngleKind
and si::marker
to hold SI specific marker traits. From
implementations for AngleKind
added to more easily convert between uom::Kind
and si::marker::AngleKind
.system!
macro. Documentation for the seven base SI quantities added.Density
to MassDensity
. A type alias for Density
is available for backwards compatibility.Density
has been renamed to MassDensity
and is deprecated. Density
will be removed in some future release.Published by iliekturtles over 5 years ago
This release adds Angle
and Jerk
quantities along with unit additions and conversion precision improvements to Acceleration
and Velocity
. Many thanks to dunmatt and nicodemus26 respectively.
Angle
quantity added.Jerk
quantity added. Acceleration
and Velocity
units added and precision for some existing units improved.rustfmt
, clippy
, and tarpaulin
jobs.rustfmt
configuration updated.clippy
configuration corrected to run for all packages.Published by iliekturtles over 5 years ago
This release adds the Momentum
quantity and additional liter
-based volume
units.
rustfmt
, clippy
, and tarpaulin
jobs.clippy
job.$quantities!
macro would fail in a Rust 2018 crate. A new test crate, edition_check
, was added to ensure uom
remains usable in Rust 2018 code.