[package]
name = "edda-admit"
version = "0.1.0"
edition = "2021"
publish = true
description = "The ONE admission trait for the nordisk suite — `Admit::plan` (what this work would cost, which class it gets, and a sentence saying why), `Admit::admit` (a slot per the plan, never blocking: a guard or a refusal with a reason) and `Admit::record` (what it actually cost, which feeds a per-kind EWMA estimate). Two implementations: `PassThrough` (always Full, only records) and `UsageShare` (rolling-window bytes per consumer; over the limit is the anonymous share; anonymous callers are an unlinkable DAY TOKEN — a keyed blake3 whose key is destroyed at the UTC day boundary, no address stored). Product-neutral: gunnar and holger both consume it."
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
keywords = ["admission", "rate-limit", "fair-share", "privacy", "quota"]
categories = ["network-programming", "concurrency"]
exclude = ["/.nornir/"]
[lib]
name = "edda_admit"
[features]
default = []
# `serde` — `Settings` (the `[admit]` table of an estate config) deserializes,
# with `limit = "none"` meaning PassThrough and sizes written as `"100 GB"`.
# OFF by default: a consumer that builds its Settings in code carries no serde.
serde = ["dep:serde"]
[dependencies]
# The day-token construction (moved AS IS from holger server/lib/src/visitors.rs,
# ea253de): a keyed blake3 over the client address, key drawn from the OS RNG and
# destroyed at the UTC day boundary. Both are already in every consumer's graph
# (gunnar: blake3 1.8.5, getrandom 0.2.17; holger: blake3 "1", getrandom "0.2").
blake3 = "1"
getrandom = "0.2"
# The ONE human-readable byte formatter — the plan's sentence reads "100 GB/30d
# used 63 GB", and a second byte formatter is exactly the twin this leaf exists
# to prevent. std-only, zero runtime deps.
nornir-humanize = { version = "0.1.3", path = "../nornir-humanize" }
serde = { version = "1", features = ["derive"], optional = true }
[dev-dependencies]
toml = "1"
serde = { version = "1", features = ["derive"] }
# The bench fans its workers out with the house engine (znippy-zoomies'
# gatling, published as `rotaryengine`) rather than a hand-rolled thread pool.
# Path + version, as edda's other gatling users: a dev-dependency never reaches
# a consumer's graph.
gatling = { path = "../../../znippy-zoomies/gatling", version = "0.1.9", package = "rotaryengine" }
# `cargo bench -p edda-admit`: plan + admit + record under 1 → N threads.
[[bench]]
name = "admit"
harness = false