gnu-units 0.2.1

Safe Rust bindings for the GNU units conversion
Documentation
[workspace]
members = [".", "gnu-units-sys"]

[package]
name = "gnu-units"
version = "0.2.1"
authors = ["Gabriele Belluardo <gabriele.belluardo@outlook.it>"]
edition = "2024"
license = "GPL-3.0-or-later"
description = "Safe Rust bindings for the GNU units conversion"
homepage = "https://github.com/gabelluardo/gnu-units"
repository = "https://github.com/gabelluardo/gnu-units"
documentation = "https://docs.rs/gnu-units"
readme = "README.md"
categories = ["api-bindings", "mathematics"]
keywords = ["gnu", "units", "conversion", "physics", "currency"]
include = ["src/**", "data/**", "Cargo.toml", "README.md", "LICENSE"]

[features]
default = ["native"]

# Use the pure-Rust unit engine.
native = ["dep:pest", "dep:pest_derive"]

# Use the vendored C library via gnu-units-sys.
vendored = ["dep:gnu-units-sys", "gnu-units-sys/vendored"]

# Regenerate checked-in FFI bindings (developer-only meaningful with vendored).
bindgen = ["gnu-units-sys?/bindgen"]

# Enable Rust-native emulation of units_cur currency update logic.
currency-update = ["dep:reqwest", "dep:serde", "dep:serde_json", "dep:chrono"]

[dependencies]
gnu-units-sys = { version = "2.27", path = "gnu-units-sys", default-features = false, optional = true }
pest = { version = "2", optional = true }
pest_derive = { version = "2", optional = true }
thiserror = "2"
reqwest = { version = "0.13", default-features = false, features = [
    "blocking",
    "json",
    "rustls",
], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
chrono = { version = "0.4", default-features = false, features = [
    "clock",
], optional = true }

[dev-dependencies]
rstest = "0.26"