casus

Crates.iocasus
lib.rscasus
version0.1.0
sourcesrc
created_at2022-12-31 05:55:49.732286
updated_at2022-12-31 05:55:49.732286
descriptionA simple library containing a handful of event-based async primitives
homepage
repositoryhttps://github.com/mrvillage/casus
max_upload_size
id748256
size13,853
mrvillage (mrvillage)

documentation

https://docs.rs/casus

README

casus

Casus is a simple library containing a handful of useful generic async primitives. At present, it contains Event and Waiter primitives.

Event

The Event primitive allows a future to await the completion of an event. Once the event is completed, all futures trying to await it will immediately return and continue until the event is reset.

use casus::Event;

let event = Event::new();

// this will block until Event::set is called elsewhere
event.wait().await;

Waiter

The Waiter primitive simply waits to be woken up with it's return value.

use casus::Waiter;

let waiter = Waiter::new();

// this will block until Event::wake is called elsewhere
waiter.await;
Commit count: 4

cargo fmt