event-notify 0.1.2

Event notify
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 0 items with examples
  • Size
  • Source code size: 9.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 302.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tryor

event-notify

English | 简体中文

event-notify provides a lightweight event listener/notification chain implementation. Create events with chained listeners where each listener can process or forward the event.

No external dependencies required — pure Rust standard library.

Features

  • Lightweight event listener pattern
  • Chained listeners via Next forwarding
  • Fire events with arbitrary payload and return types
  • Zero dependencies

Cargo Feature Flags

This crate has no Cargo feature flags. All functionality is enabled by default.

Basic Usage

use event_notify::Event;

let event = Event::<i32, i32>::listen(|args, _next| {
    args * 2
}).finish();

let result = event.fire(21);
assert_eq!(result, 42);

Tests

cargo test -p event-notify

7 tests covering single listener, chained listeners, chain break, and multiple fire scenarios.

License

Licensed under either of Apache License 2.0 or MIT license at your option.