casus 0.1.0

A simple library containing a handful of event-based async primitives
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented1 out of 9 items with examples
  • Size
  • Source code size: 13.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.67 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • mrvillage/casus
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mrvillage

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;