Trait rust_htslib::bcf::Read
[−]
[src]
pub trait Read: Sized { fn read(&mut self, record: &mut Record) -> Result<(), ReadError>; fn records(&mut self) -> Records<Self>; fn header(&self) -> &HeaderView; fn empty_record(&self) -> Record; fn set_threads(&mut self, n_threads: usize) -> Result<(), ThreadingError>; }
A trait for a BCF reader with a read method.
Required Methods
fn read(&mut self, record: &mut Record) -> Result<(), ReadError>
Read the next record.
Arguments
- record - an empty record, that can be created with
bcf::Reader::empty_record
.
ⓘImportant traits for Records<'a, R>
fn records(&mut self) -> Records<Self>
Return an iterator over all records of the VCF/BCF file.
fn header(&self) -> &HeaderView
Return the header.
fn empty_record(&self) -> Record
Return empty record. Can be reused multiple times.
fn set_threads(&mut self, n_threads: usize) -> Result<(), ThreadingError>
Activate multi-threaded BCF/VCF read support in htslib. This should permit faster reading of large VCF files.
Setting nthreads
to 0
does not change the current state. Note that it is not
possible to set the number of background threads below 1
once it has been set.
Arguments
n_threads
- number of extra background writer threads to use, must be> 0
.
Implementors
impl Read for Reader
impl Read for IndexedReader