[package]
build = "build.rs"
description = "this crate focuses on implementing various actors for the eryon framework"
name = "eryon-actors"

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 = ["full"]
rustc-args = ["--cfg", "docsrs" ]
version = "v{{version}}"

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

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

[dependencies]
# local
eryon-core = { workspace = true }
eryon-mem = { workspace = true }
eryon-surface = { workspace = true }
# custom
concision = { workspace = true }
rshyper = { workspace = true }
rstmt = { workspace = true }
scsys = { features = ["time"], workspace = true }
# concurrency & parallelism
rayon = { optional = true, workspace = true }
# error handling
anyhow = { optional = true, workspace = true }
thiserror = { workspace = true }
# math
approx = { optional = true, workspace = true }
ndarray = { workspace = true }
num = { workspace = true }
num-traits = { workspace = true }
rustfft = { workspace = true }
# random
rand = { optional = true, workspace = true }
rand_distr = { optional = true, workspace = true }
# serialization
serde = { optional = true, workspace = true }
serde_derive = { optional = true, workspace = true }
serde_json = { optional = true, workspace = true }
# misc
paste = { workspace = true }
strum = { features = ["derive"], workspace = true }
# logging
tracing = { optional = true, workspace = true }

[dev-dependencies]
tracing-subscriber = { features = ["time"], workspace = true }

[features]
default = [
    "std",
]

full = [
    "default",
    "anyhow",
    "rand",
    "serde",
    "tracing"
]

nightly = [
    "eryon-core/nightly",
]

# ************* [FF:Environments] *************
std = [
    "alloc",
    "anyhow?/std",
    "concision/std",
    "eryon-core/std",
    "eryon-mem/std",
    "eryon-surface/std",
    "rand?/std_rng",
    "rand_distr?/std",
    "rshyper/std",
    "rstmt/std",
    "scsys/std",
    "serde?/std",
    "serde_json?/std",
    "strum/std",
    "rand?/std",
    "tracing?/std",
    "thiserror/std",
]

wasi = [
    "eryon-core/wasi",
    "eryon-mem/wasi",
    "eryon-surface/wasi",
    "rshyper/wasi",
    "rstmt/wasi",
    "scsys/wasi",
]

wasm = [
    "eryon-core/wasm",
    "eryon-mem/wasm",
    "eryon-surface/wasm",
    "rayon?/web_spin_lock",
    "rshyper/wasm",
    "rstmt/wasm",
    "scsys/wasm",
]

# ************* [FF:Dependencies] *************
alloc = [
    "concision/alloc",
    "rshyper/alloc",
    "rstmt/alloc",
    "serde?/alloc",
    "serde_json?/alloc",
    "scsys/alloc",
]

anyhow = [
    "dep:anyhow",
    "eryon-core/anyhow",
    "eryon-mem/anyhow",
    "eryon-surface/anyhow",
    "rstmt/anyhow",
    "scsys/anyhow",
]

approx = [
    "dep:approx",
    "concision/approx",
    "ndarray/approx",
    "eryon-surface/approx",
]

blas = [
    "concision/blas",
    "ndarray/blas",
    "eryon-surface/blas",
]

json = [
    "eryon-core/json",
    "eryon-mem/json",
    "eryon-surface/json",
    "rshyper/json",
    "rstmt/json",
    "scsys/json",
    "serde",
    "serde_json",
    "std",

]

rand = [
    "dep:rand",
    "dep:rand_distr",
    "concision/rand",
    "num/rand",
    "eryon-core/rand",
    "eryon-mem/rand",
    "eryon-surface/rand",
    "rng",
    "rshyper/rand",
    "rstmt/rand",
    "scsys/rand",
]

rayon = [
    "dep:rayon",
    "concision/rayon",
    "rshyper/rayon",
    # "rstmt/rayon",
]

rng = [
    "eryon-core/rng",
    "eryon-mem/rng",
    "eryon-surface/rng",
    "rand/small_rng",
    "rand/thread_rng",
    "rshyper/rng",
    "rstmt/rng",
    "scsys/rng",
]

serde = [
    "dep:serde",
    "dep:serde_derive",
    "concision/serde",
    "num/serde",
    "eryon-core/serde",
    "eryon-mem/serde",
    "eryon-surface/serde",
    "rshyper/serde",
    "rstmt/serde",
    "scsys/serde",
]

serde_json = ["dep:serde_json"]

tracing = [
    "dep:tracing",
    "concision/tracing",
    "eryon-core/tracing",
    "eryon-mem/tracing",
    "eryon-surface/tracing",
    "rshyper/tracing",
    "rstmt/tracing",
    "scsys/tracing",
]

# ************* [Examples] *************
[[example]]
name = "neural_engine"
required-features = ["approx", "rand", "tracing"]

[[example]]
name = "plant"
required-features = ["approx", "rand", "tracing"]

[[example]]
name = "vnode"
required-features = ["approx", "rand", "tracing"]

# ************* [Unit Tests] *************
[[test]]
name = "default"
required-features = []

[[test]]
name = "plant"
required-features = ["approx"]

[[test]]
name = "vnode"
required-features = []
