use-event-handler 0.1.0

Synchronous event handler trait for RustUse event primitives.
Documentation
  • Coverage
  • 16.67%
    1 out of 6 items documented1 out of 3 items with examples
  • Size
  • Source code size: 4.99 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 258.91 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-event
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-event-handler

Synchronous event handler trait for RustUse event primitives.

Install

[dependencies]
use-event-handler = "0.1.0"

Example

use core::convert::Infallible;
use use_event_handler::EventHandler;

let handler = |event: &str| -> Result<usize, Infallible> { Ok(event.len()) };

assert_eq!(handler.handle("command.started"), Ok(15));

Scope

  • Define a small synchronous handler trait.
  • Support closures and functions through a blanket implementation.
  • Keep output and error types caller-defined.

Non-Goals

  • No async runtime.
  • No scheduling, queueing, or dispatch loop.
  • No middleware or framework behavior.

Status

Experimental v0.1.0 primitive.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license