pub trait Read: Sized {
// Required methods
fn read(&mut self, record: &mut Record) -> Option<Result<()>>;
fn records(&mut self) -> Records<'_, Self> ⓘ;
fn header(&self) -> &HeaderView;
fn empty_record(&self) -> Record;
fn set_threads(&mut self, n_threads: usize) -> Result<()>;
}
Expand description
A trait for a BCF reader with a read method.
Required Methods§
Sourcefn records(&mut self) -> Records<'_, Self> ⓘ
fn records(&mut self) -> Records<'_, Self> ⓘ
Return an iterator over all records of the VCF/BCF file.
Sourcefn header(&self) -> &HeaderView
fn header(&self) -> &HeaderView
Return the header.
Sourcefn empty_record(&self) -> Record
fn empty_record(&self) -> Record
Return empty record. Can be reused multiple times.
Sourcefn set_threads(&mut self, n_threads: usize) -> Result<()>
fn set_threads(&mut self, n_threads: usize) -> Result<()>
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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.