[package]
name = "grafeo-storage"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
description = "Persistence layer for Grafeo: WAL, container format, section I/O"

[dependencies]
grafeo-common.workspace = true

# Error handling
thiserror.workspace = true

# Serialization
serde.workspace = true
bincode.workspace = true
bytes.workspace = true
byteorder.workspace = true

# Concurrency
parking_lot.workspace = true
crossbeam = { workspace = true, optional = true }

# Checksums (always needed for section directory CRC)
crc32fast.workspace = true

# I/O (optional, feature-gated)
memmap2 = { workspace = true, optional = true }
fs2 = { workspace = true, optional = true }

# Async (optional)
tokio = { workspace = true, optional = true }

# Tracing (optional, zero-cost when disabled)
tracing = { workspace = true, optional = true }

[dev-dependencies]
tempfile.workspace = true
serde_json = "1"

[features]
default = ["wal"]
wal = ["memmap2", "tokio", "crossbeam"]
async-storage = ["wal"]
grafeo-file = ["wal", "fs2"]
tracing = ["dep:tracing", "grafeo-common/tracing"]
testing-crash-injection = ["grafeo-common/testing-crash-injection"]

[lints]
workspace = true
