epicenter

Crates.ioepicenter
lib.rsepicenter
version0.1.0
sourcesrc
created_at2023-12-19 09:50:01.57102
updated_at2023-12-20 02:57:13.713202
descriptionSimple synchronous and asynchronous event dispatcher for Rust
homepage
repositoryhttps://github.com/m1guelpf/epicenter
max_upload_size
id1074140
size11,850
Miguel Piedrafita (m1guelpf)

documentation

README

Epicenter

Simple sync/async event dispatcher for Rust

crates.io download count badge docs.rs

Usage

use epicenter::{Event, AsyncDispatcher};

#[derive(Debug, Clone)]
struct ExampleEvent {}
impl Event for ExampleEvent {}

let mut dispatcher = AsyncDispatcher::new();

dispatcher.listen(|event: ExampleEvent| async move {
    // ...
}).await;

dispatcher.dispatch(&ExampleEvent {}).await?;

Refer to the documentation on docs.rs for detailed usage instructions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 4

cargo fmt