[−][src]Function seq_io::parallel::read_process_fasta_records_init
pub fn read_process_fasta_records_init<R, Ri, S, W, F, O, Out, E>(
reader_init: Ri,
n_workers: u32,
queue_len: usize,
work: W,
func: F
) -> Result<Option<Out>, E> where
R: RecordSetReader<RecordSet = RecordSet<S>, Err = Error>,
Ri: Send + FnOnce() -> Result<R, E>,
O: Default + Send,
S: PositionStore,
W: Send + Sync + Fn(RefRecord<'_, S>, &mut O),
F: FnMut(RefRecord<'_, S>, &mut O) -> Option<Out>,
E: Send + From<R::Err>,
Like
read_process_fasta_records
, but instead of a RecordSetReader
, it takes a
closure (reader_init
) returning an RecordSetReader
instance.
This allows using readers that don't implement Send
.
reader_init
should return a result. The error type needs to
implement From<RecordSetReader::Err>