[package]
name = "nautilus-serialization"
readme = "README.md"
build = "build.rs"
include = [
  "src/**/*",
  "schemas/**/*",
  "generated/**/*",
  "tests/**/*",
  "benches/**/*",
  "build.rs",
  "Cargo.toml",
  "README.md",
]
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
description = "Serialization functionality for the Nautilus trading engine"
categories.workspace = true
keywords.workspace = true
documentation.workspace = true
repository.workspace = true
homepage.workspace = true

[lints]
workspace = true

[lib]
name = "nautilus_serialization"
crate-type = ["rlib"]

[features]
default = []
arrow = ["dep:arrow", "nautilus-model/arrow"]
capnp = ["dep:capnp"]
display = ["arrow"]
sbe = []
extension-module = [
  "nautilus-core/extension-module",
  "nautilus-model/extension-module",
  "python",
  "pyo3/extension-module",
]
python = [
  "nautilus-core/python",
  "nautilus-model/python",
  "pyo3",
  "pyo3-stub-gen",
]
high-precision = ["nautilus-model/high-precision"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
nautilus-core = { workspace = true }
nautilus-model = { workspace = true, features = ["stubs"] }

anyhow = { workspace = true }
indexmap = { workspace = true }
rust_decimal = { workspace = true }
rust_decimal_macros = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
ustr = { workspace = true }
uuid = { workspace = true }

arrow = { workspace = true, optional = true }
capnp = { workspace = true, optional = true }
pyo3 = { workspace = true, optional = true }
pyo3-stub-gen = { workspace = true, optional = true }

[dev-dependencies]
criterion = { workspace = true }
pretty_assertions = { workspace = true }
rstest = { workspace = true }

[build-dependencies]
capnpc = { workspace = true }
walkdir = { workspace = true }

[[bench]]
name = "capnp_serialization"
path = "benches/capnp_serialization.rs"
harness = false
required-features = ["capnp"]

[[bench]]
name = "serialization_comparison"
path = "benches/serialization_comparison.rs"
harness = false

[[bench]]
name = "sbe_decoding"
path = "benches/sbe_decoding.rs"
harness = false
required-features = ["sbe"]

[[bench]]
name = "market_data_capnp_vs_sbe"
path = "benches/market_data_capnp_vs_sbe.rs"
harness = false
required-features = ["capnp", "sbe"]
