runlimit_core/lib.rs
1//! Framework-neutral contracts shared by Runlimit storage backends.
2//!
3//! This crate defines anchored fixed-window policies, opaque subject keys,
4//! checks, and backend-independent decisions. It deliberately contains no
5//! async runtime, transport framework, or persistence integration.
6//!
7//! Applications own subject normalization and policy selection. Raw subjects
8//! should be converted to [`SubjectKey`] values with [`KeyHasher`] before they
9//! cross into a storage backend.
10
11mod batch;
12mod check;
13mod counter;
14mod decision;
15mod identifier;
16mod key;
17mod policy;
18
19pub use batch::{BatchError, validate_batch};
20pub use check::{Check, CheckError};
21pub use counter::CounterKey;
22pub use decision::{BatchDecision, Decision, Denial};
23pub use identifier::{IdentifierError, MAX_IDENTIFIER_LENGTH, PolicyId, ScopeId};
24pub use key::{KeyHasher, KeyHasherError, SubjectKey};
25pub use policy::{
26 FixedWindowPolicy, MAX_LIMIT, MAX_WINDOW, MAX_WINDOW_MILLIS, PolicyError, PolicyFingerprint,
27};