[][src]Struct uniprot::parser::ThreadedParser

pub struct ThreadedParser<B: BufRead> { /* fields omitted */ }

A parser for the Uniprot XML format that parses entries in parallel.

Methods

impl<B: BufRead> ThreadedParser<B>[src]

pub fn new(reader: B) -> Self[src]

Create a new ThreadedParser using all available CPUs.

This number of threads is extracted at runtime using the num_cpus::get function, which returns the number of virtual CPUs, that can differ from the number of physical CPUs if the processor supports hyperthreading.

pub fn with_threads(reader: B, threads: NonZeroUsize) -> Self[src]

Create a new ThreadedParser with the requested number of threads.

This function can be useful to fine tune the number of threads to use, or in the case of a program to allow the number of threads to be given as an argument (like make with the -j flag).

Note that at least one thread is always going to be spawned; use the SequentialParser instead to keep everything in the main thread.

Trait Implementations

impl<B: BufRead> Iterator for ThreadedParser<B>[src]

type Item = Result<Entry, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<B> !RefUnwindSafe for ThreadedParser<B>

impl<B> Send for ThreadedParser<B> where
    B: Send

impl<B> Sync for ThreadedParser<B> where
    B: Sync

impl<B> Unpin for ThreadedParser<B> where
    B: Unpin

impl<B> !UnwindSafe for ThreadedParser<B>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.