[package]
name = "hl7v2"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
homepage = "https://github.com/EffortlessMetrics/hl7v2-rs"
documentation = "https://docs.rs/hl7v2"
description = "HL7 v2 message parser and processor for Rust"
readme = "README.md"

[features]
default = [
    "json",
    "profile",
    "ack",
    "normalize",
]

json = []
profile = ["profile-core", "persistent-cache"]
profile-core = [
    "dep:chrono",
    "dep:serde_yaml",
    "dep:regex",
    "dep:tokio",
    "dep:reqwest",
    "dep:lru",
    "dep:async-lock",
]
persistent-cache = ["profile-core", "dep:sqlx", "dep:sha2", "dep:hex"]
ack = ["dep:chrono"]
normalize = []
batch = []
stream = ["dep:tokio"]
network = ["stream", "dep:tokio-util", "dep:futures", "dep:bytes"]
synthetic = [
    "ack",
    "dep:chrono",
    "dep:rand",
    "dep:rand_distr",
    "dep:serde_yaml",
    "dep:sha2",
    "dep:uuid",
]
redact = ["dep:sha2", "dep:toml"]
lifecycle = ["dep:chrono", "dep:sha2"]
experimental-guard = []

[dependencies]
thiserror = { workspace = true }
serde = { workspace = true, features = ["derive"] }
chrono = { workspace = true, features = ["serde"], optional = true }
sha2 = { workspace = true, optional = true }
toml = { version = "1.1.2", optional = true }
regex = { workspace = true, optional = true }
rand = { version = "0.10.0", optional = true }
rand_distr = { version = "0.6.0", optional = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true, optional = true }
uuid = { workspace = true, features = ["v4"], optional = true }
tokio = { workspace = true, features = [
    "fs",
    "net",
    "io-util",
    "time",
    "macros",
    "rt",
    "sync",
], optional = true }
tokio-util = { workspace = true, features = ["codec"], optional = true }
futures = { workspace = true, optional = true }
bytes = { workspace = true, optional = true }
reqwest = { version = "0.12", default-features = false, features = [
    "rustls-tls-webpki-roots",
    "http2",
], optional = true }
lru = { version = "0.16", optional = true }
async-lock = { version = "3.4", optional = true }
sqlx = { version = "0.8.6", features = [
    "runtime-tokio",
    "postgres",
    "chrono",
    "migrate",
], optional = true }
hex = { workspace = true, optional = true }

[dev-dependencies]
proptest = "1.6"
tempfile = "3.26.0"
wiremock = "0.6"

[lints]
workspace = true
