Module range

Source
Expand description

Parallel iterator types for ranges, the type for values created by a..b expressions

You will rarely need to interact with this module directly unless you have need to name one of the iterator types.

use rayon::prelude::*;

let r = (0..100u64).into_par_iter()
                   .sum();

// compare result with sequential calculation
assert_eq!((0..100).sum::<u64>(), r);

Modulesยง

private ๐Ÿ”’
These traits help drive integer type inference. Without them, an unknown {integer} type only has constraints on Iter<{integer}>, which will probably give up and use i32. By adding these traits on the item type, the compiler can see a more direct constraint to infer like {integer}: RangeInteger, which works better. See test_issue_833 for an example.

Macrosยง

convert_char ๐Ÿ”’
indexed_range_impl ๐Ÿ”’
unindexed_range_impl ๐Ÿ”’

Structsยง

Iter
Parallel iterator over a range, implemented for all integer types and char.
IterProducer ๐Ÿ”’

Traitsยง

UnindexedRangeLen ๐Ÿ”’