tokenizers::utils::parallelism

Trait MaybeParallelBridge

Source
pub trait MaybeParallelBridge<T, S>
where S: Iterator<Item = T> + Send, T: Send,
{ // Required methods fn maybe_par_bridge(self) -> CondIterator<IterBridge<S>, S>; fn maybe_par_bridge_cond(self, cond: bool) -> CondIterator<IterBridge<S>, S>; }
Expand description

Converts any serial iterator into a CondIterator, that can either run parallelly or serially.

Required Methods§

Implementors§

Source§

impl<T, S> MaybeParallelBridge<T, S> for S
where S: Iterator<Item = T> + Send, T: Send,