Expand description
C-compatible FFI bindings for qtty.
qtty-ffi exposes a stable ABI around qtty’s unit registry and
conversion logic. It is intended for C and C++ adapters, and for Rust
crates that need to mirror qtty quantities across an FFI boundary.
§What this crate provides
- ABI-stable carrier structs such as
QttyQuantityandQttyDerivedQuantity - stable
UnitIdandDimensionIddiscriminants extern "C"functions for construction, conversion, validation, and formatting- a generated public header at
include/qtty_ffi.h - optional Rust-side
qtty_serdeandpyo3helpers
§Quick Start (C/C++)
#include "qtty_ffi.h"
qtty_quantity_t meters;
qtty_quantity_make(1000.0, UNIT_ID_METER, &meters);
qtty_quantity_t kilometers;
if (qtty_quantity_convert(meters, UNIT_ID_KILOMETER, &kilometers) == QTTY_OK) {
/* kilometers.value == 1.0 */
}§Quick Start (Rust)
use qtty::Meter;
use qtty_ffi::{QttyQuantity, UnitId};
let qty: QttyQuantity = Meter::new(12.5).into();
assert_eq!(qty.unit, UnitId::Meter as u32);§ABI Stability
Existing UnitId and DimensionId values, carrier layouts, status
codes, and exported function signatures are part of the ABI contract.
New units or functions may be added in future releases, but existing values
remain stable.
§Error Handling
All FFI functions return status codes:
QttyStatus::Ok(0): SuccessQttyStatus::UnknownUnit(-1): Invalid unit IDQttyStatus::IncompatibleDim(-2): Dimension mismatchQttyStatus::NullOut(-3): Null output pointerQttyStatus::BufferTooSmall(-4): Output buffer too smallQttyStatus::InternalPanic(-5): Rust panic caught at the FFI boundary
Format flags for qtty_quantity_format:
QTTY_FMT_DEFAULT(0): decimal notationQTTY_FMT_LOWER_EXP(1): scientific notation (lowercasee)QTTY_FMT_UPPER_EXP(2): scientific notation (uppercaseE)
§Thread Safety
All functions are thread-safe. The library contains no global mutable state.
Modules§
- helpers
- Trait implementations for downstream crate integration.
- macros
- Macros for implementing FFI conversions for qtty unit types.
- registry
- Unit registry and conversion logic for FFI.
Macros§
- impl_
unit_ ffi - Implements
From<$qty_type>forQttyQuantityandTryFrom<QttyQuantity>for$qty_type.
Structs§
- Qtty
Derived Quantity - A derived quantity representing a compound unit (numerator/denominator).
- Qtty
Quantity - A POD quantity carrier type suitable for FFI.
Enums§
- Dimension
Id - Dimension identifier for FFI.
- Qtty
Status - Status codes returned by every qtty-ffi function.
- UnitId
- Unit identifier for FFI.
Constants§
- QTTY_
FMT_ DEFAULT - Format flag: default decimal notation (e.g.
"1234.57 m"). - QTTY_
FMT_ LOWER_ EXP - Format flag: scientific notation with lowercase
e(e.g."1.23e3 m"). - QTTY_
FMT_ UPPER_ EXP - Format flag: scientific notation with uppercase
E(e.g."1.23E3 m"). - QTTY_
UNIT_ ACRE - Raw unit ID constant for Acre (Area).
- QTTY_
UNIT_ AIRMASS - Raw unit ID constant for Airmass (Dimensionless).
- QTTY_
UNIT_ ALBEDO - Raw unit ID constant for Albedo (Dimensionless).
- QTTY_
UNIT_ AMPERE - Raw unit ID constant for Ampere (Current).
- QTTY_
UNIT_ ARCMINUTE - Raw unit ID constant for Arcminute (Angle).
- QTTY_
UNIT_ ARCSECOND - Raw unit ID constant for Arcsecond (Angle).
- QTTY_
UNIT_ ARE - Raw unit ID constant for Are (Area).
- QTTY_
UNIT_ ASTRONOMICAL_ UNIT - Raw unit ID constant for AstronomicalUnit (Length).
- QTTY_
UNIT_ ATMOSPHERE - Raw unit ID constant for Atmosphere (Pressure).
- QTTY_
UNIT_ ATOMIC_ MASS_ UNIT - Raw unit ID constant for AtomicMassUnit (Mass).
- QTTY_
UNIT_ ATTOGRAM - Raw unit ID constant for Attogram (Mass).
- QTTY_
UNIT_ ATTOMETER - Raw unit ID constant for Attometer (Length).
- QTTY_
UNIT_ ATTOSECOND - Raw unit ID constant for Attosecond (Time).
- QTTY_
UNIT_ ATTOWATT - Raw unit ID constant for Attowatt (Power).
- QTTY_
UNIT_ BAR - Raw unit ID constant for Bar (Pressure).
- QTTY_
UNIT_ BOHR_ RADIUS - Raw unit ID constant for BohrRadius (Length).
- QTTY_
UNIT_ BRITISH_ THERMAL_ UNIT - Raw unit ID constant for BritishThermalUnit (Energy).
- QTTY_
UNIT_ CALORIE - Raw unit ID constant for Calorie (Energy).
- QTTY_
UNIT_ CANDELA - Raw unit ID constant for Candela (LuminousIntensity).
- QTTY_
UNIT_ CARAT - Raw unit ID constant for Carat (Mass).
- QTTY_
UNIT_ CENTIGRAM - Raw unit ID constant for Centigram (Mass).
- QTTY_
UNIT_ CENTILITER - Raw unit ID constant for Centiliter (Volume).
- QTTY_
UNIT_ CENTIMETER - Raw unit ID constant for Centimeter (Length).
- QTTY_
UNIT_ CENTISECOND - Raw unit ID constant for Centisecond (Time).
- QTTY_
UNIT_ CENTURY - Raw unit ID constant for Century (Time).
- QTTY_
UNIT_ CHAIN - Raw unit ID constant for Chain (Length).
- QTTY_
UNIT_ CLASSICAL_ ELECTRON_ RADIUS - Raw unit ID constant for ClassicalElectronRadius (Length).
- QTTY_
UNIT_ COULOMB - Raw unit ID constant for Coulomb (Charge).
- QTTY_
UNIT_ CUBIC_ CENTIMETER - Raw unit ID constant for CubicCentimeter (Volume).
- QTTY_
UNIT_ CUBIC_ FOOT - Raw unit ID constant for CubicFoot (Volume).
- QTTY_
UNIT_ CUBIC_ INCH - Raw unit ID constant for CubicInch (Volume).
- QTTY_
UNIT_ CUBIC_ KILOMETER - Raw unit ID constant for CubicKilometer (Volume).
- QTTY_
UNIT_ CUBIC_ METER - Raw unit ID constant for CubicMeter (Volume).
- QTTY_
UNIT_ CUBIC_ MILLIMETER - Raw unit ID constant for CubicMillimeter (Volume).
- QTTY_
UNIT_ DAY - Raw unit ID constant for Day (Time).
- QTTY_
UNIT_ DECADE - Raw unit ID constant for Decade (Time).
- QTTY_
UNIT_ DECAGRAM - Raw unit ID constant for Decagram (Mass).
- QTTY_
UNIT_ DECAMETER - Raw unit ID constant for Decameter (Length).
- QTTY_
UNIT_ DECASECOND - Raw unit ID constant for Decasecond (Time).
- QTTY_
UNIT_ DECAWATT - Raw unit ID constant for Decawatt (Power).
- QTTY_
UNIT_ DECIGRAM - Raw unit ID constant for Decigram (Mass).
- QTTY_
UNIT_ DECILITER - Raw unit ID constant for Deciliter (Volume).
- QTTY_
UNIT_ DECIMETER - Raw unit ID constant for Decimeter (Length).
- QTTY_
UNIT_ DECISECOND - Raw unit ID constant for Decisecond (Time).
- QTTY_
UNIT_ DECIWATT - Raw unit ID constant for Deciwatt (Power).
- QTTY_
UNIT_ DEGREE - Raw unit ID constant for Degree (Angle).
- QTTY_
UNIT_ DYNE - Raw unit ID constant for Dyne (Force).
- QTTY_
UNIT_ EARTH_ EQUATORIAL_ CIRCUMFERENCE - Raw unit ID constant for EarthEquatorialCircumference (Length).
- QTTY_
UNIT_ EARTH_ MERIDIONAL_ CIRCUMFERENCE - Raw unit ID constant for EarthMeridionalCircumference (Length).
- QTTY_
UNIT_ ELECTRONVOLT - Raw unit ID constant for Electronvolt (Energy).
- QTTY_
UNIT_ ELECTRON_ REDUCED_ COMPTON_ WAVELENGTH - Raw unit ID constant for ElectronReducedComptonWavelength (Length).
- QTTY_
UNIT_ ERG - Raw unit ID constant for Erg (Energy).
- QTTY_
UNIT_ ERG_ PER_ SECOND - Raw unit ID constant for ErgPerSecond (Power).
- QTTY_
UNIT_ ERG_ PER_ SECOND_ SQUARE_ CENTIMETER_ STERADIAN - Raw unit ID constant for ErgPerSecondSquareCentimeterSteradian (Radiance).
- QTTY_
UNIT_ ERG_ PER_ SECOND_ SQUARE_ CENTIMETER_ STERADIAN_ ANGSTROM - Raw unit ID constant for ErgPerSecondSquareCentimeterSteradianAngstrom (SpectralRadiance).
- QTTY_
UNIT_ EXAGRAM - Raw unit ID constant for Exagram (Mass).
- QTTY_
UNIT_ EXAMETER - Raw unit ID constant for Exameter (Length).
- QTTY_
UNIT_ EXAWATT - Raw unit ID constant for Exawatt (Power).
- QTTY_
UNIT_ FARAD - Raw unit ID constant for Farad (Capacitance).
- QTTY_
UNIT_ FATHOM - Raw unit ID constant for Fathom (Length).
- QTTY_
UNIT_ FEMTOGRAM - Raw unit ID constant for Femtogram (Mass).
- QTTY_
UNIT_ FEMTOMETER - Raw unit ID constant for Femtometer (Length).
- QTTY_
UNIT_ FEMTOSECOND - Raw unit ID constant for Femtosecond (Time).
- QTTY_
UNIT_ FEMTOWATT - Raw unit ID constant for Femtowatt (Power).
- QTTY_
UNIT_ FOOT - Raw unit ID constant for Foot (Length).
- QTTY_
UNIT_ FORTNIGHT - Raw unit ID constant for Fortnight (Time).
- QTTY_
UNIT_ GIGAGRAM - Raw unit ID constant for Gigagram (Mass).
- QTTY_
UNIT_ GIGAHERTZ - Raw unit ID constant for Gigahertz (Frequency).
- QTTY_
UNIT_ GIGAJOULE - Raw unit ID constant for Gigajoule (Energy).
- QTTY_
UNIT_ GIGAMETER - Raw unit ID constant for Gigameter (Length).
- QTTY_
UNIT_ GIGANEWTON - Raw unit ID constant for Giganewton (Force).
- QTTY_
UNIT_ GIGAPARSEC - Raw unit ID constant for Gigaparsec (Length).
- QTTY_
UNIT_ GIGAPASCAL - Raw unit ID constant for Gigapascal (Pressure).
- QTTY_
UNIT_ GIGASECOND - Raw unit ID constant for Gigasecond (Time).
- QTTY_
UNIT_ GIGAWATT - Raw unit ID constant for Gigawatt (Power).
- QTTY_
UNIT_ GRADIAN - Raw unit ID constant for Gradian (Angle).
- QTTY_
UNIT_ GRAIN - Raw unit ID constant for Grain (Mass).
- QTTY_
UNIT_ GRAM - Raw unit ID constant for Gram (Mass).
- QTTY_
UNIT_ GRAM_ PER_ CUBIC_ CENTIMETER - Raw unit ID constant for GramPerCubicCentimeter (Density).
- QTTY_
UNIT_ GRAM_ PER_ MILLILITER - Raw unit ID constant for GramPerMilliliter (Density).
- QTTY_
UNIT_ HECTARE - Raw unit ID constant for Hectare (Area).
- QTTY_
UNIT_ HECTOGRAM - Raw unit ID constant for Hectogram (Mass).
- QTTY_
UNIT_ HECTOMETER - Raw unit ID constant for Hectometer (Length).
- QTTY_
UNIT_ HECTOPASCAL - Raw unit ID constant for Hectopascal (Pressure).
- QTTY_
UNIT_ HECTOSECOND - Raw unit ID constant for Hectosecond (Time).
- QTTY_
UNIT_ HECTOWATT - Raw unit ID constant for Hectowatt (Power).
- QTTY_
UNIT_ HENRY - Raw unit ID constant for Henry (Inductance).
- QTTY_
UNIT_ HERTZ - Raw unit ID constant for Hertz (Frequency).
- QTTY_
UNIT_ HORSEPOWER_ ELECTRIC - Raw unit ID constant for HorsepowerElectric (Power).
- QTTY_
UNIT_ HORSEPOWER_ METRIC - Raw unit ID constant for HorsepowerMetric (Power).
- QTTY_
UNIT_ HOUR - Raw unit ID constant for Hour (Time).
- QTTY_
UNIT_ HOUR_ ANGLE - Raw unit ID constant for HourAngle (Angle).
- QTTY_
UNIT_ ILLUMINATION_ FRACTION - Raw unit ID constant for IlluminationFraction (Dimensionless).
- QTTY_
UNIT_ INCH - Raw unit ID constant for Inch (Length).
- QTTY_
UNIT_ INCH_ OF_ MERCURY - Raw unit ID constant for InchOfMercury (Pressure).
- QTTY_
UNIT_ JOULE - Raw unit ID constant for Joule (Energy).
- QTTY_
UNIT_ JULIAN_ CENTURY - Raw unit ID constant for JulianCentury (Time).
- QTTY_
UNIT_ JULIAN_ YEAR - Raw unit ID constant for JulianYear (Time).
- QTTY_
UNIT_ KELVIN - Raw unit ID constant for Kelvin (Temperature).
- QTTY_
UNIT_ KILOAMPERE - Raw unit ID constant for Kiloampere (Current).
- QTTY_
UNIT_ KILOCALORIE - Raw unit ID constant for Kilocalorie (Energy).
- QTTY_
UNIT_ KILOCOULOMB - Raw unit ID constant for Kilocoulomb (Charge).
- QTTY_
UNIT_ KILOELECTRONVOLT - Raw unit ID constant for Kiloelectronvolt (Energy).
- QTTY_
UNIT_ KILOGRAM - Raw unit ID constant for Kilogram (Mass).
- QTTY_
UNIT_ KILOGRAM_ PER_ CUBIC_ METER - Raw unit ID constant for KilogramPerCubicMeter (Density).
- QTTY_
UNIT_ KILOHERTZ - Raw unit ID constant for Kilohertz (Frequency).
- QTTY_
UNIT_ KILOHM - Raw unit ID constant for Kilohm (Resistance).
- QTTY_
UNIT_ KILOJOULE - Raw unit ID constant for Kilojoule (Energy).
- QTTY_
UNIT_ KILOLUMEN - Raw unit ID constant for Kilolumen (LuminousFlux).
- QTTY_
UNIT_ KILOLUX - Raw unit ID constant for Kilolux (Illuminance).
- QTTY_
UNIT_ KILOMETER - Raw unit ID constant for Kilometer (Length).
- QTTY_
UNIT_ KILOMOLE - Raw unit ID constant for Kilomole (AmountOfSubstance).
- QTTY_
UNIT_ KILONEWTON - Raw unit ID constant for Kilonewton (Force).
- QTTY_
UNIT_ KILOPARSEC - Raw unit ID constant for Kiloparsec (Length).
- QTTY_
UNIT_ KILOPASCAL - Raw unit ID constant for Kilopascal (Pressure).
- QTTY_
UNIT_ KILOSECOND - Raw unit ID constant for Kilosecond (Time).
- QTTY_
UNIT_ KILOVOLT - Raw unit ID constant for Kilovolt (Voltage).
- QTTY_
UNIT_ KILOWATT - Raw unit ID constant for Kilowatt (Power).
- QTTY_
UNIT_ KILOWATT_ HOUR - Raw unit ID constant for KilowattHour (Energy).
- QTTY_
UNIT_ LIGHT_ YEAR - Raw unit ID constant for LightYear (Length).
- QTTY_
UNIT_ LINK - Raw unit ID constant for Link (Length).
- QTTY_
UNIT_ LITER - Raw unit ID constant for Liter (Volume).
- QTTY_
UNIT_ LONG_ TON - Raw unit ID constant for LongTon (Mass).
- QTTY_
UNIT_ LUMEN - Raw unit ID constant for Lumen (LuminousFlux).
- QTTY_
UNIT_ LUX - Raw unit ID constant for Lux (Illuminance).
- QTTY_
UNIT_ MEGAELECTRONVOLT - Raw unit ID constant for Megaelectronvolt (Energy).
- QTTY_
UNIT_ MEGAGRAM - Raw unit ID constant for Megagram (Mass).
- QTTY_
UNIT_ MEGAHERTZ - Raw unit ID constant for Megahertz (Frequency).
- QTTY_
UNIT_ MEGAJOULE - Raw unit ID constant for Megajoule (Energy).
- QTTY_
UNIT_ MEGAMETER - Raw unit ID constant for Megameter (Length).
- QTTY_
UNIT_ MEGANEWTON - Raw unit ID constant for Meganewton (Force).
- QTTY_
UNIT_ MEGAOHM - Raw unit ID constant for Megaohm (Resistance).
- QTTY_
UNIT_ MEGAPARSEC - Raw unit ID constant for Megaparsec (Length).
- QTTY_
UNIT_ MEGAPASCAL - Raw unit ID constant for Megapascal (Pressure).
- QTTY_
UNIT_ MEGASECOND - Raw unit ID constant for Megasecond (Time).
- QTTY_
UNIT_ MEGAVOLT - Raw unit ID constant for Megavolt (Voltage).
- QTTY_
UNIT_ MEGAWATT - Raw unit ID constant for Megawatt (Power).
- QTTY_
UNIT_ METER - Raw unit ID constant for Meter (Length).
- QTTY_
UNIT_ METER_ PER_ SECOND_ SQUARED - Raw unit ID constant for MeterPerSecondSquared (Acceleration).
- QTTY_
UNIT_ MICROAMPERE - Raw unit ID constant for Microampere (Current).
- QTTY_
UNIT_ MICROCOULOMB - Raw unit ID constant for Microcoulomb (Charge).
- QTTY_
UNIT_ MICROFARAD - Raw unit ID constant for Microfarad (Capacitance).
- QTTY_
UNIT_ MICROGRAM - Raw unit ID constant for Microgram (Mass).
- QTTY_
UNIT_ MICROHENRY - Raw unit ID constant for Microhenry (Inductance).
- QTTY_
UNIT_ MICROJOULE - Raw unit ID constant for Microjoule (Energy).
- QTTY_
UNIT_ MICROLITER - Raw unit ID constant for Microliter (Volume).
- QTTY_
UNIT_ MICROMETER - Raw unit ID constant for Micrometer (Length).
- QTTY_
UNIT_ MICROMOLE - Raw unit ID constant for Micromole (AmountOfSubstance).
- QTTY_
UNIT_ MICRONEWTON - Raw unit ID constant for Micronewton (Force).
- QTTY_
UNIT_ MICROSECOND - Raw unit ID constant for Microsecond (Time).
- QTTY_
UNIT_ MICROTESLA - Raw unit ID constant for Microtesla (MagneticFluxDensity).
- QTTY_
UNIT_ MICROVOLT - Raw unit ID constant for Microvolt (Voltage).
- QTTY_
UNIT_ MICROWATT - Raw unit ID constant for Microwatt (Power).
- QTTY_
UNIT_ MICRO_ ARCSECOND - Raw unit ID constant for MicroArcsecond (Angle).
- QTTY_
UNIT_ MILE - Raw unit ID constant for Mile (Length).
- QTTY_
UNIT_ MILLENNIUM - Raw unit ID constant for Millennium (Time).
- QTTY_
UNIT_ MILLIAMPERE - Raw unit ID constant for Milliampere (Current).
- QTTY_
UNIT_ MILLICOULOMB - Raw unit ID constant for Millicoulomb (Charge).
- QTTY_
UNIT_ MILLIFARAD - Raw unit ID constant for Millifarad (Capacitance).
- QTTY_
UNIT_ MILLIGRAM - Raw unit ID constant for Milligram (Mass).
- QTTY_
UNIT_ MILLIHENRY - Raw unit ID constant for Millihenry (Inductance).
- QTTY_
UNIT_ MILLIHERTZ - Raw unit ID constant for Millihertz (Frequency).
- QTTY_
UNIT_ MILLIJOULE - Raw unit ID constant for Millijoule (Energy).
- QTTY_
UNIT_ MILLILITER - Raw unit ID constant for Milliliter (Volume).
- QTTY_
UNIT_ MILLILUMEN - Raw unit ID constant for Millilumen (LuminousFlux).
- QTTY_
UNIT_ MILLILUX - Raw unit ID constant for Millilux (Illuminance).
- QTTY_
UNIT_ MILLIMETER - Raw unit ID constant for Millimeter (Length).
- QTTY_
UNIT_ MILLIMETER_ OF_ MERCURY - Raw unit ID constant for MillimeterOfMercury (Pressure).
- QTTY_
UNIT_ MILLIMOLE - Raw unit ID constant for Millimole (AmountOfSubstance).
- QTTY_
UNIT_ MILLINEWTON - Raw unit ID constant for Millinewton (Force).
- QTTY_
UNIT_ MILLIOHM - Raw unit ID constant for Milliohm (Resistance).
- QTTY_
UNIT_ MILLIPASCAL - Raw unit ID constant for Millipascal (Pressure).
- QTTY_
UNIT_ MILLIRADIAN - Raw unit ID constant for Milliradian (Angle).
- QTTY_
UNIT_ MILLISECOND - Raw unit ID constant for Millisecond (Time).
- QTTY_
UNIT_ MILLITESLA - Raw unit ID constant for Millitesla (MagneticFluxDensity).
- QTTY_
UNIT_ MILLIVOLT - Raw unit ID constant for Millivolt (Voltage).
- QTTY_
UNIT_ MILLIWATT - Raw unit ID constant for Milliwatt (Power).
- QTTY_
UNIT_ MILLIWEBER - Raw unit ID constant for Milliweber (MagneticFlux).
- QTTY_
UNIT_ MILLI_ ARCSECOND - Raw unit ID constant for MilliArcsecond (Angle).
- QTTY_
UNIT_ MINUTE - Raw unit ID constant for Minute (Time).
- QTTY_
UNIT_ MOLE - Raw unit ID constant for Mole (AmountOfSubstance).
- QTTY_
UNIT_ NANOFARAD - Raw unit ID constant for Nanofarad (Capacitance).
- QTTY_
UNIT_ NANOGRAM - Raw unit ID constant for Nanogram (Mass).
- QTTY_
UNIT_ NANOJOULE - Raw unit ID constant for Nanojoule (Energy).
- QTTY_
UNIT_ NANOMETER - Raw unit ID constant for Nanometer (Length).
- QTTY_
UNIT_ NANOMOLE - Raw unit ID constant for Nanomole (AmountOfSubstance).
- QTTY_
UNIT_ NANOSECOND - Raw unit ID constant for Nanosecond (Time).
- QTTY_
UNIT_ NANOWATT - Raw unit ID constant for Nanowatt (Power).
- QTTY_
UNIT_ NAUTICAL_ MILE - Raw unit ID constant for NauticalMile (Length).
- QTTY_
UNIT_ NEWTON - Raw unit ID constant for Newton (Force).
- QTTY_
UNIT_ NOMINAL_ EARTH_ EQUATORIAL_ RADIUS - Raw unit ID constant for NominalEarthEquatorialRadius (Length).
- QTTY_
UNIT_ NOMINAL_ EARTH_ POLAR_ RADIUS - Raw unit ID constant for NominalEarthPolarRadius (Length).
- QTTY_
UNIT_ NOMINAL_ EARTH_ RADIUS - Raw unit ID constant for NominalEarthRadius (Length).
- QTTY_
UNIT_ NOMINAL_ JUPITER_ RADIUS - Raw unit ID constant for NominalJupiterRadius (Length).
- QTTY_
UNIT_ NOMINAL_ LUNAR_ DISTANCE - Raw unit ID constant for NominalLunarDistance (Length).
- QTTY_
UNIT_ NOMINAL_ LUNAR_ RADIUS - Raw unit ID constant for NominalLunarRadius (Length).
- QTTY_
UNIT_ NOMINAL_ SOLAR_ DIAMETER - Raw unit ID constant for NominalSolarDiameter (Length).
- QTTY_
UNIT_ NOMINAL_ SOLAR_ RADIUS - Raw unit ID constant for NominalSolarRadius (Length).
- QTTY_
UNIT_ OHM - Raw unit ID constant for Ohm (Resistance).
- QTTY_
UNIT_ OPTICAL_ DEPTH - Raw unit ID constant for OpticalDepth (Dimensionless).
- QTTY_
UNIT_ OUNCE - Raw unit ID constant for Ounce (Mass).
- QTTY_
UNIT_ PARSEC - Raw unit ID constant for Parsec (Length).
- QTTY_
UNIT_ PASCAL - Raw unit ID constant for Pascal (Pressure).
- QTTY_
UNIT_ PETAGRAM - Raw unit ID constant for Petagram (Mass).
- QTTY_
UNIT_ PETAMETER - Raw unit ID constant for Petameter (Length).
- QTTY_
UNIT_ PETAWATT - Raw unit ID constant for Petawatt (Power).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ CENTIMETER_ NANOSECOND_ STERADIAN - Raw unit ID constant for PhotonPerSquareCentimeterNanosecondSteradian (PhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ CENTIMETER_ NANOSECOND_ STERADIAN_ NANOMETER - Raw unit ID constant for PhotonPerSquareCentimeterNanosecondSteradianNanometer (SpectralPhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ CENTIMETER_ SECOND_ STERADIAN - Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradian (PhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ CENTIMETER_ SECOND_ STERADIAN_ ANGSTROM - Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradianAngstrom (SpectralPhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ CENTIMETER_ SECOND_ STERADIAN_ NANOMETER - Raw unit ID constant for PhotonPerSquareCentimeterSecondSteradianNanometer (SpectralPhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ METER_ SECOND_ STERADIAN - Raw unit ID constant for PhotonPerSquareMeterSecondSteradian (PhotonRadiance).
- QTTY_
UNIT_ PHOTON_ PER_ SQUARE_ METER_ SECOND_ STERADIAN_ METER - Raw unit ID constant for PhotonPerSquareMeterSecondSteradianMeter (SpectralPhotonRadiance).
- QTTY_
UNIT_ PICOFARAD - Raw unit ID constant for Picofarad (Capacitance).
- QTTY_
UNIT_ PICOGRAM - Raw unit ID constant for Picogram (Mass).
- QTTY_
UNIT_ PICOJOULE - Raw unit ID constant for Picojoule (Energy).
- QTTY_
UNIT_ PICOMETER - Raw unit ID constant for Picometer (Length).
- QTTY_
UNIT_ PICOSECOND - Raw unit ID constant for Picosecond (Time).
- QTTY_
UNIT_ PICOWATT - Raw unit ID constant for Picowatt (Power).
- QTTY_
UNIT_ PLANCK_ LENGTH - Raw unit ID constant for PlanckLength (Length).
- QTTY_
UNIT_ POUND - Raw unit ID constant for Pound (Mass).
- QTTY_
UNIT_ POUND_ FORCE - Raw unit ID constant for PoundForce (Force).
- QTTY_
UNIT_ POUND_ PER_ CUBIC_ FOOT - Raw unit ID constant for PoundPerCubicFoot (Density).
- QTTY_
UNIT_ POUND_ PER_ SQUARE_ INCH - Raw unit ID constant for PoundPerSquareInch (Pressure).
- QTTY_
UNIT_ RADIAN - Raw unit ID constant for Radian (Angle).
- QTTY_
UNIT_ RANKINE - Raw unit ID constant for Rankine (Temperature).
- QTTY_
UNIT_ REFRACTIVITY - Raw unit ID constant for Refractivity (Dimensionless).
- QTTY_
UNIT_ ROD - Raw unit ID constant for Rod (Length).
- QTTY_
UNIT_ S10 - Raw unit ID constant for S10 (InverseSolidAngle).
- QTTY_
UNIT_ SECOND - Raw unit ID constant for Second (Time).
- QTTY_
UNIT_ SHORT_ TON - Raw unit ID constant for ShortTon (Mass).
- QTTY_
UNIT_ SIDEREAL_ DAY - Raw unit ID constant for SiderealDay (Time).
- QTTY_
UNIT_ SIDEREAL_ YEAR - Raw unit ID constant for SiderealYear (Time).
- QTTY_
UNIT_ SOLAR_ LUMINOSITY - Raw unit ID constant for SolarLuminosity (Power).
- QTTY_
UNIT_ SOLAR_ MASS - Raw unit ID constant for SolarMass (Mass).
- QTTY_
UNIT_ SQUARE_ ARCMINUTE - Raw unit ID constant for SquareArcminute (SolidAngle).
- QTTY_
UNIT_ SQUARE_ ARCSECOND - Raw unit ID constant for SquareArcsecond (SolidAngle).
- QTTY_
UNIT_ SQUARE_ CENTIMETER - Raw unit ID constant for SquareCentimeter (Area).
- QTTY_
UNIT_ SQUARE_ DEGREE - Raw unit ID constant for SquareDegree (SolidAngle).
- QTTY_
UNIT_ SQUARE_ FOOT - Raw unit ID constant for SquareFoot (Area).
- QTTY_
UNIT_ SQUARE_ INCH - Raw unit ID constant for SquareInch (Area).
- QTTY_
UNIT_ SQUARE_ KILOMETER - Raw unit ID constant for SquareKilometer (Area).
- QTTY_
UNIT_ SQUARE_ METER - Raw unit ID constant for SquareMeter (Area).
- QTTY_
UNIT_ SQUARE_ MILE - Raw unit ID constant for SquareMile (Area).
- QTTY_
UNIT_ SQUARE_ MILLIMETER - Raw unit ID constant for SquareMillimeter (Area).
- QTTY_
UNIT_ SQUARE_ MILLIRADIAN - Raw unit ID constant for SquareMilliradian (SolidAngle).
- QTTY_
UNIT_ SQUARE_ YARD - Raw unit ID constant for SquareYard (Area).
- QTTY_
UNIT_ STANDARD_ GRAVITY - Raw unit ID constant for StandardGravity (Acceleration).
- QTTY_
UNIT_ STERADIAN - Raw unit ID constant for Steradian (SolidAngle).
- QTTY_
UNIT_ STONE - Raw unit ID constant for Stone (Mass).
- QTTY_
UNIT_ SYNODIC_ MONTH - Raw unit ID constant for SynodicMonth (Time).
- QTTY_
UNIT_ TERAGRAM - Raw unit ID constant for Teragram (Mass).
- QTTY_
UNIT_ TERAHERTZ - Raw unit ID constant for Terahertz (Frequency).
- QTTY_
UNIT_ TERAJOULE - Raw unit ID constant for Terajoule (Energy).
- QTTY_
UNIT_ TERAMETER - Raw unit ID constant for Terameter (Length).
- QTTY_
UNIT_ TERASECOND - Raw unit ID constant for Terasecond (Time).
- QTTY_
UNIT_ TERAWATT - Raw unit ID constant for Terawatt (Power).
- QTTY_
UNIT_ TESLA - Raw unit ID constant for Tesla (MagneticFluxDensity).
- QTTY_
UNIT_ THERM - Raw unit ID constant for Therm (Energy).
- QTTY_
UNIT_ TONNE - Raw unit ID constant for Tonne (Mass).
- QTTY_
UNIT_ TORR - Raw unit ID constant for Torr (Pressure).
- QTTY_
UNIT_ TRANSMITTANCE - Raw unit ID constant for Transmittance (Dimensionless).
- QTTY_
UNIT_ TURN - Raw unit ID constant for Turn (Angle).
- QTTY_
UNIT_ US_ FLUID_ OUNCE - Raw unit ID constant for UsFluidOunce (Volume).
- QTTY_
UNIT_ US_ GALLON - Raw unit ID constant for UsGallon (Volume).
- QTTY_
UNIT_ VOLT - Raw unit ID constant for Volt (Voltage).
- QTTY_
UNIT_ WATT - Raw unit ID constant for Watt (Power).
- QTTY_
UNIT_ WATT_ HOUR - Raw unit ID constant for WattHour (Energy).
- QTTY_
UNIT_ WATT_ PER_ SQUARE_ METER_ STERADIAN - Raw unit ID constant for WattPerSquareMeterSteradian (Radiance).
- QTTY_
UNIT_ WATT_ PER_ SQUARE_ METER_ STERADIAN_ METER - Raw unit ID constant for WattPerSquareMeterSteradianMeter (SpectralRadiance).
- QTTY_
UNIT_ WATT_ PER_ SQUARE_ METER_ STERADIAN_ NANOMETER - Raw unit ID constant for WattPerSquareMeterSteradianNanometer (SpectralRadiance).
- QTTY_
UNIT_ WEBER - Raw unit ID constant for Weber (MagneticFlux).
- QTTY_
UNIT_ WEEK - Raw unit ID constant for Week (Time).
- QTTY_
UNIT_ YARD - Raw unit ID constant for Yard (Length).
- QTTY_
UNIT_ YEAR - Raw unit ID constant for Year (Time).
- QTTY_
UNIT_ YOCTOGRAM - Raw unit ID constant for Yoctogram (Mass).
- QTTY_
UNIT_ YOCTOMETER - Raw unit ID constant for Yoctometer (Length).
- QTTY_
UNIT_ YOCTOWATT - Raw unit ID constant for Yoctowatt (Power).
- QTTY_
UNIT_ YOTTAGRAM - Raw unit ID constant for Yottagram (Mass).
- QTTY_
UNIT_ YOTTAMETER - Raw unit ID constant for Yottameter (Length).
- QTTY_
UNIT_ YOTTAWATT - Raw unit ID constant for Yottawatt (Power).
- QTTY_
UNIT_ ZEPTOGRAM - Raw unit ID constant for Zeptogram (Mass).
- QTTY_
UNIT_ ZEPTOMETER - Raw unit ID constant for Zeptometer (Length).
- QTTY_
UNIT_ ZEPTOWATT - Raw unit ID constant for Zeptowatt (Power).
- QTTY_
UNIT_ ZETTAGRAM - Raw unit ID constant for Zettagram (Mass).
- QTTY_
UNIT_ ZETTAMETER - Raw unit ID constant for Zettameter (Length).
- QTTY_
UNIT_ ZETTAWATT - Raw unit ID constant for Zettawatt (Power).
Functions§
- qtty_
derived_ ⚠convert - Converts a derived quantity to different units.
- qtty_
derived_ ⚠make - Creates a new derived quantity (compound unit like m/s).
- qtty_
ffi_ version - Returns the FFI ABI version (major10000 + minor100 + patch).
- qtty_
quantity_ ⚠convert - Converts a quantity to a different unit.
- qtty_
quantity_ ⚠convert_ value - Converts a raw value from one unit to another.
- qtty_
quantity_ ⚠format - Formats a quantity as a human-readable string into a caller-provided buffer.
- qtty_
quantity_ ⚠make - Creates a new quantity with the given value and unit.
- qtty_
unit_ ⚠dimension - Gets the dimension of a unit.
- qtty_
unit_ is_ valid - Checks if a raw unit ID is valid (recognized by the registry).
- qtty_
unit_ name - Gets the name of a unit as a NUL-terminated C string.
- qtty_
units_ ⚠compatible - Checks if two units are compatible (same dimension).