rayon-join-macro 0.1.1

A convenience n-nary macro around `rayon::join()`
Documentation
  • Coverage
  • 40%
    2 out of 5 items documented2 out of 4 items with examples
  • Size
  • Source code size: 7.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 157.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jakubadamw/rayon-join-macro
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jakubadamw

rayon-join-macro

Build status crates.io docs.rs License: MIT

A wrapper around rayon::join that accepts more than 2 and up to 8 closures to be run in parallel.

Documentation

#[macro_use] extern crate rayon_join_macro;

fn main() {
    use rayon_join_macro::ConsTuple;

    fn factorial(n: usize) -> usize {
        if n == 0 { 1 } else { n * factorial(n - 1) }
    }

    let (a, b, c): (u16, String, usize) = join!(
        || (1..=50).sum(),
        || "abc".repeat(3),
        || factorial(8)
    );

    assert_eq!(a, 1275);
    assert_eq!(b, "abcabcabc");
    assert_eq!(c, 40320);
}