[package]
name = "unit-intervals"
version = "0.1.0"
edition = "2024"
authors = ["Markus Mayer <widemeadows@gmail.com>"]
description = "Constrained f32/f64 wrapper types for normalized [0, 1] and [-1, 1] values."
license = "EUPL-1.2"
repository = "https://github.com/sunsided/unit-intervals"
keywords = ["unit-interval", "normalized", "probability", "float", "no-std"]
categories = ["data-structures", "mathematics", "no-std"]
[features]
default = ["std"]
assertions = []
std = []
unsafe = []
arbitrary = ["dep:arbitrary"]
bytemuck = ["dep:bytemuck"]
num-traits = ["dep:num-traits"]
serde = ["dep:serde"]
rkyv = ["dep:rkyv"]
rand_distr = ["dep:rand", "dep:rand_distr"]
[dependencies]
arbitrary = { version = "1.4", optional = true }
bytemuck = { version = "1.25", default-features = false, optional = true }
num-traits = { version = "0.2.19", default-features = false, optional = true }
rand = { version = "0.10", default-features = false, optional = true }
rand_distr = { version = "0.6", default-features = false, optional = true }
rkyv = { version = "0.8.16", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
[dev-dependencies]
rand = { version = "0.10", default-features = false, features = ["std_rng"] }
rkyv = { version = "0.8.16", features = ["alloc"] }
serde_json = "1.0"
[[test]]
name = "arbitrary"
path = "tests/arbitrary.rs"
required-features = ["arbitrary"]
[[test]]
name = "bytemuck"
path = "tests/bytemuck.rs"
required-features = ["bytemuck"]
[[test]]
name = "num_traits"
path = "tests/num_traits.rs"
required-features = ["num-traits"]
[[test]]
name = "rkyv"
path = "tests/rkyv.rs"
required-features = ["rkyv"]
[[test]]
name = "rand_distr"
path = "tests/rand_distr.rs"
required-features = ["rand_distr"]
[[test]]
name = "serde"
path = "tests/serde.rs"
required-features = ["serde"]
[[test]]
name = "std"
path = "tests/std.rs"
required-features = ["std"]
[[test]]
name = "unsafe"
path = "tests/unsafe.rs"
required-features = ["unsafe"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]