decdn-protocol 0.1.0

Wire protocol types and ALPN definitions for deCDN
Documentation
[package]
name = "decdn-protocol"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
description = "Wire protocol types and ALPN definitions for deCDN"
repository.workspace = true
homepage.workspace = true
readme = "README.md"
keywords.workspace = true
categories.workspace = true

[dependencies]
serde = { workspace = true }
postcard = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }

[dev-dependencies]
proptest = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt"] }
# `Region`'s serde round-trip (#1348). Dev-only on purpose: this crate is a
# deliberate leaf (serde + postcard + thiserror + tokio), and JSON is the
# consumer-side format (the `decdn-client` peer store), not one this crate speaks. `postcard`
# would serialize a `&str` length-prefixed, which cannot assert the property
# under test — that a `Region` encodes as the plain 2-character string.
serde_json = { workspace = true }
# Public-API stability snapshot (issue #304). Only exercised by the
# `public_api` test target below, which is gated behind `public-api-test`.
public-api = { workspace = true }
rustdoc-json = { workspace = true }
insta = { workspace = true }

[features]
# Gates the slow, nightly-dependent `public_api` snapshot test out of the
# default `cargo nextest --workspace` (coverage) run. CI's dedicated
# `public-api` job opts in with `--features public-api-test`.
public-api-test = []
# Makes the discovery-block size overridable via
# `override_discovery_block_bytes_for_test`, so a downstream loopback test can
# drive the block-spanning planner with tiny blocks (and thus tiny blobs)
# instead of the 64 MiB a real two-block blob needs. Off by default, so a
# production build reads the fixed `DISCOVERY_BLOCK_BYTES` constant and is
# byte-identical; only enabled through dev-dependencies (see `decdn-node`).
test-support = []

# The public-API snapshot test shells out to a nightly rustdoc and is slow, so
# it is compiled/run only when `public-api-test` is enabled (see CONTRIBUTING.md
# § Public API snapshot). `required-features` makes Cargo skip the target
# entirely otherwise.
[[test]]
name = "public_api"
path = "tests/public_api.rs"
required-features = ["public-api-test"]

[lints]
workspace = true