s2n-events is a library designed to be consumed by an event generation program within a project. It automates the creation of boilerplate code for event types and traits based on project-specific configuration.
Instead of manually implementing complex event requirements, you can use a generator (like the event-generator crate found in this repository) to scan Rust files for event definitions and generate a single, audited, and IDE-friendly Rust file containing:
Subscriber trait implementations (including on_{event_name} callbacks).Publisher trait implementations.Event trait implementations.#[non_exhaustive] attributes to ensure forward compatibility.- Builder types for constructing events externally.
- Logic for forwarding events to child-subscribers.
- Integration with built-in subscribers (e.g.,
tracing, serde). - Test subscriber counters.