[package]
build = "build.rs"
description = "the core modules for the rstmt framework"
name = "rstmt-core"

authors.workspace = true
categories.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[package.metadata.docs.rs]
all-features = false
features = ["alloc", "complex", "hashbrown", "serde", "std"]
rustc-args = ["--cfg", "docsrs"]
version = "v{{version}}"

[package.metadata.release]
no-dev-version = true
tag-name = "v{{version}}"

[lib]
bench = false
crate-type = ["cdylib", "rlib", "staticlib"]
doc = true
doctest = true
test = true

[dependencies]
rstmt-traits = { workspace = true }
# custom
contained = { workspace = true }
variants = { workspace = true }
# concurrency & parallelism
rayon-core = { optional = true, workspace = true }
# data structures
hashbrown = { optional = true, workspace = true }
# error-handling
anyhow = { workspace = true }
thiserror = { workspace = true }
# mathematics
num-complex = { optional = true, workspace = true }
num-integer = { workspace = true }
num-traits = { workspace = true }
# randomization
getrandom = { optional = true, workspace = true }
rand = { optional = true, workspace = true }
rand_core = { optional = true, workspace = true }
rand_distr = { optional = true, workspace = true }
# serialization
serde = { features = ["derive"], optional = true, workspace = true }
serde_derive = { optional = true, workspace = true }
serde_json = { optional = true, workspace = true }
# macros & utilities
paste = { workspace = true }
smart-default = { workspace = true }
strum = { features = ["derive"], workspace = true }

[features]
default = ["std"]

full = [
  "default",
  "complex",
  "hashbrown",
  "json",
  "rand",
  "serde",
]

nightly = [
  "hashbrown?/nightly",
  "rstmt-traits/nightly",
]

# ************* [FF:Environments] *************
std = [
  "alloc",
  "anyhow/std",
  "contained/std",
  "hashbrown?/default",
  "num-complex?/std",
  "num-integer/std",
  "num-traits/std",
  "rand?/std",
  "rand_distr?/std",
  "rstmt-traits/std",
  "serde?/std",
  "strum/std",
  "variants/std",
]

wasi = [
  "rstmt-traits/wasi",
]

wasm = [
  "rstmt-traits/wasm",
  "getrandom?/wasm_js",
  "rayon-core?/web_spin_lock",
]
# ************* [FF:Dependencies] *************
alloc = [
  "rstmt-traits/alloc",
  "contained/alloc",
  "hashbrown?/alloc",
  "rand?/alloc",
  "rand_distr?/alloc",
  "serde?/alloc",
  "serde_json?/alloc",
  "variants/alloc",
]

complex = ["dep:num-complex"]

hashbrown = [
  "dep:hashbrown", 
  "rstmt-traits/hashbrown"
]

json = ["alloc", "serde_json"]

rand = [
  "rng",
  "dep:rand",
  "dep:rand_core",
  "dep:rand_distr",
  "rstmt-traits/rand",
  "num-complex?/rand",
]

rayon = [
  "dep:rayon-core",
  "hashbrown?/rayon",
  "rstmt-traits/rayon",
]

rng = [
  "dep:getrandom",
  "rand?/small_rng",
  "rand?/thread_rng",
]

serde = [
  "dep:serde",
  "dep:serde_derive",
  "hashbrown?/serde",
  "rstmt-traits/serde",
  "serde?/derive",
  "num-complex/serde",
]

serde_json = ["dep:serde_json"]
