promissory 0.1.3

One-shot value exhange between threads
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 1 items with examples
  • Size
  • Source code size: 37.68 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.45 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • electroCutie

One-shot value exhange between threads. The consumer thread may await the producer thread Both the producer and consumer are single use

Just a wrapper around a std::mpsc channel with an API that makes it impossible to use more than once

Example

let (send, recv) = promissory::promissory();
std::thread::spawn(move || send.fulfill(42u32));
assert_eq!(42, recv.await_value()?;