captrack 0.1.0

Capacity telemetry for Rust collections — call-site macros that record peak capacity, with zero overhead when disabled.
[package]
name = "captrack"
version = "0.1.0"
edition = "2021"
authors = ["Marat K <phpcraftdream@gmail.com>"]
rust-version = "1.74"
description = "Capacity telemetry for Rust collections — call-site macros that record peak capacity, with zero overhead when disabled."
license = "MIT OR Apache-2.0"
repository = "https://github.com/PHPCraftdream/captrack"
homepage = "https://github.com/PHPCraftdream/captrack"
documentation = "https://docs.rs/captrack"
readme = "README.md"
keywords = ["telemetry", "capacity", "profiling", "collections", "performance"]
categories = ["development-tools::profiling"]
include = [
    "src/**/*",
    "examples/**/*",
    "tests/**/*",
    "Cargo.toml",
    "README.md",
    "CHANGELOG.md",
    "CONTRIBUTING.md",
    "LICENSE-APACHE",
    "LICENSE-MIT",
    "clippy.toml.example",
]

[workspace]
members = [".", "captrack-macros", "captrack-pgo"]
exclude = ["captrack-pgo-lint"]

[features]
default = []
# Axis 1: telemetry on/off
# Enables TrackedX wrappers, global registry, and JSON dump.
# Without this feature all macros expand to bare constructors with zero overhead.
telemetry = ["dep:scc", "dep:serde", "dep:serde_json", "dep:bytes", "dep:indexmap", "dep:dashmap", "dep:ctor", "dep:smallvec", "dep:fastrand", "dep:hashbrown"]

# Axis 2A: default hasher (select at most one; default = RandomState)
fxhash     = ["dep:fxhash"]
ahash      = ["dep:ahash"]
foldhash   = ["dep:foldhash"]
rustc-hash = ["dep:rustc-hash"]

# Off-feature alias mirror features — pull in the dep WITHOUT activating telemetry.
# Consumers add e.g. `captrack = { features = ["bytes"] }` to get `TrackedBytesMut`
# as a type alias to `bytes::BytesMut` in off-feature mode.
# (When `telemetry` is active these are redundant — the real Tracked* structs win.)
bytes     = ["dep:bytes"]
indexmap  = ["dep:indexmap"]
dashmap   = ["dep:dashmap"]
scc       = ["dep:scc"]
smallvec  = ["dep:smallvec"]
hashbrown = ["dep:hashbrown"]

[dependencies]
captrack-macros = { path = "captrack-macros", version = "0.1.0" }

# Optional — pulled in only with `telemetry`.
scc        = { version = "2.2",  optional = true }
serde      = { version = "1",    optional = true, features = ["derive"] }
serde_json = { version = "1",    optional = true }
# On-exit auto-dump hook (only active with `telemetry`).
ctor       = { version = "0.2",  optional = true }
fastrand   = { version = "2",    optional = true }

# Optional collection deps — callers bring their own; listed here so that
# off-feature macro expansions can reference the types in doc-examples and
# tests.  Real consumers add these as their own direct deps.
bytes      = { version = "1",    optional = true }
indexmap   = { version = "2",    optional = true }
dashmap    = { version = "6",    optional = true }
smallvec   = { version = "1",    optional = true }
hashbrown  = { version = "0.15", optional = true }

# Hasher backends (optional, axis 2A)
fxhash     = { version = "0.2",  optional = true }
ahash      = { version = "0.8",  optional = true }
foldhash   = { version = "0.1",  optional = true }
rustc-hash = { version = "2",    optional = true }

[package.metadata.docs.rs]
# Build docs with all features so users see the full API on docs.rs.
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dev-dependencies]
# Needed for the crate's own test suite which exercises macros that expand
# to these types.  External callers bring their own deps.
scc        = "2.2"
bytes      = "1"
indexmap   = "2"
dashmap    = "6"
smallvec   = "1"
hashbrown  = "0.15"
serde_json = "1"
tempfile   = "3"
fxhash     = "0.2"
ahash      = "0.8"

[lib]
doctest = false