[package]
name = "eva-common"
version = "0.4.1"
edition = "2024"
authors = ["Serhij S. <div@altertech.com>"]
license = "Apache-2.0"
repository = "https://github.com/eva-ics/eva4-common"
description = "Commons for EVA ICS v4"
readme = "README.md"
keywords = ["eva-ics", "iot", "industrial", "scada", "cloud"]

[package.metadata.docs.rs]
features = ["acl", "actions", "events", "time", "bus-rpc", "services", "registry", "workers",
  "dataconv", "db", "cache", "hyper-tools", "extended-value", "common-payloads", "payload",
  "logic", "logger", "axum", "serde-keyvalue", "time", "console-logger", "data-objects"]

[package.metadata.playground]
features = ["acl", "actions", "events", "time", "bus-rpc", "services", "registry", "workers",
  "dataconv", "db", "cache", "hyper-tools", "extended-value", "common-payloads", "payload",
  "logic", "logger", "axum", "serde-keyvalue", "time", "console-logger", "data-objects"]

[lib]
name = "eva_common"
path = "src/lib.rs"

[dependencies]
serde = { version = "1.0.143", default-features = false, features = ["derive", "std", "rc"] }
serde_repr = "0.1.7"
serde_json = "1.0.83"
ordered-float = "2.8.0"
log = "0.4.14"
ipnetwork = "0.20.0"
rust_decimal = "1.39.0"
libloading = { version = "0.7.0", optional = true }
busrt = { version = "0.5", features = ["ipc","rpc"], optional = true }
nix = { version = "0.25.0", features = ["time", "user"], optional = true }
rmp-serde = { version = "1.1.2", optional = true }
uuid = { version = "1.1.2", features = ["serde", "v4"], optional = true }
bmart = { version = "0.2.6", optional = true }
tokio = { version = "1.20.1", features = ["full"], optional = true }
async-recursion = { version = "1.0.0", optional = true }
async-channel = { version = "1.7.1", optional = true }
hex = { version = "0.4.3", optional = true }
regex = { version = "1.6.0", optional = true }
yedb = { version = "0.5.1", optional = true }
sqlx = { version = "0.8", features = [ "runtime-tokio-native-tls" , "sqlite", "postgres" ], optional = true }
hyper = { version = "0.14.18", optional = true }
serde_yaml = { version = "0.1.3", optional = true, package = "serde_yaml2" }
rand = { version = "0.8.5", optional = true }
hyper-static = { version = "0.1.5", optional = true }
submap = { version = "0.3.3", optional = true }
dateparser = { version = "0.1.7", optional = true }
openssl = { version = "0.10.63", optional = true }
axum = { version = "0.6.12", default-features=false, features=[], optional = true }
parking_lot = { package = "parking_lot_rt", version = "0.12.1" }
nom = { version = "7.1.3", optional = true }
num-traits = { version = "0.2.17", optional = true }
thiserror = { version = "1.0.51", optional = true }
remain = { version = "0.2.11", optional = true }
chrono = { version = "0.4.31", optional = true }
env_logger = { version = "0.10", optional = true }
binrw = { version = "0.13.3", optional = true }
gst = { version = "0.24", package = "gstreamer", optional = true }
gst-video = { version = "0.24", package = "gstreamer-video", optional = true }
strum = { version = "0.27", features = ["derive", "strum_macros"], optional = true }

[features]
nostd = []
#ext = ["payload", "log", "libloading"]
acl = ["dep:submap"] # access control lists
events = ["acl"] # common events
services = ["bus-rpc", "dep:tokio", "registry", "dep:nix"] # service structures and tools
actions = ["dep:uuid"] # action structures and tools
registry = ["dep:busrt", "payload"]
logger = ["dep:async-channel", "dep:busrt", "dep:tokio", "payload", "dep:uuid"]
extended-value = ["dep:bmart", "dep:async-recursion", "dep:serde_yaml", "dep:tokio"]
time = ["dep:nix", "dep:dateparser", "dep:chrono"] # timestamp helpers
db = ["dep:yedb", "dep:sqlx"] # db bindings
openssl-vendored = ["openssl/vendored"]
bus-rpc = ["dep:busrt", "payload"] # bus/rt bindings
serde-keyvalue = ["dep:nom", "dep:num-traits", "dep:thiserror", "dep:remain"]
workers = ["dep:bmart", "dep:tokio"] # misc workers
dataconv = ["dep:hex", "dep:regex", "dep:uuid"] # data conversion bindings
cache = ["dep:tokio", "dep:sqlx", "payload"]
payload = ["dep:rmp-serde"]
logic = []
common-payloads = ["dep:uuid", "dep:rand", "acl"]
hyper-tools = ["dep:hyper", "dep:hyper-static"]
full = ["acl", "actions", "events", "time", "bus-rpc", "services", "registry", "workers",
  "dataconv", "db", "cache", "hyper-tools", "extended-value", "common-payloads", "payload",
  "logic", "logger", "axum", "serde-keyvalue", "dep:chrono", "console-logger", "data-objects", "multimedia"]
skip_self_test_serde = []
fips = ["openssl", "yedb/fips"]
console-logger = ["dep:env_logger"]
data-objects = ["dep:binrw"]
multimedia = ["dep:gst", "dep:gst-video", "dep:binrw", "dep:strum"]
