[−][src]Function seq_io::parallel::read_parallel_init
pub fn read_parallel_init<R, E, Ri, Er, O, Di, Ed, W, F, Out>(
n_threads: u32,
queue_len: usize,
reader_init: Ri,
dataset_init: Di,
work: W,
func: F
) -> Result<Out, E> where
R: Reader,
Ri: Send + FnOnce() -> Result<R, Er>,
Er: Send,
E: From<Er> + From<Ed>,
O: Send,
Di: Send + Sync + FnMut() -> Result<R::DataSet, Ed>,
W: Send + Sync + Fn(&mut R::DataSet) -> O,
F: FnOnce(&mut ParallelRecordsets<R::DataSet, R::Err, O>) -> Out,
This function allows initiating the reader and datasets using a closure.
This is more flexible and allows readers not to be Send