Expand description
This module defines helpers to allow optional Rayon usage.
Constants§
Traits§
- Maybe
Parallel Bridge - Converts any serial iterator into a CondIterator, that can either run parallelly or serially.
- Maybe
Parallel Iterator - Allows to convert into an iterator that can be executed either parallelly or serially.
- Maybe
Parallel RefIterator - Shared reference version of MaybeParallelIterator, works the same but returns an iterator over references, does not consume self
- Maybe
Parallel RefMut Iterator - Exclusive reference version of MaybeParallelIterator, works the same but returns an iterator over mutable references, does not consume self
- Maybe
Parallel Slice - Allows to convert into
chunks
that can be executed either parallelly or serially.
Functions§
- current_
num_ threads - Returns the number of threads in the current registry. If this code is executing within a Rayon thread-pool, then this will be the number of threads for the thread-pool of the current thread. Otherwise, it will be the number of threads for the global thread-pool.
- get_
parallelism - has_
parallelism_ been_ used - Check if at some point we used a parallel iterator
- is_
parallelism_ configured - Check if the TOKENIZERS_PARALLELISM env variable has been explicitly set
- set_
parallelism - Set the value for
TOKENIZERS_PARALLELISM
for the current process