Trait rust_htslib::bam::Read
[−]
[src]
pub trait Read: Sized { fn read(&self, record: &mut Record) -> Result<(), ReadError>; fn records(&self) -> Records<Self>; fn pileup(&self) -> Pileups; fn bgzf(&self) -> *mut Struct_BGZF; fn header(&self) -> &HeaderView; fn seek(&self, offset: i64) -> Result<(), SeekError> { ... } fn tell(&self) -> i64 { ... } }
A trait for a BAM reader with a read method.
Required Methods
fn read(&self, record: &mut Record) -> Result<(), ReadError>
Read next BAM record into given record. Use this method in combination with a single allocated record to avoid the reallocations occurring with the iterator.
Arguments
record
- the record to be filled
fn records(&self) -> Records<Self>
Iterator over the records of the seeked region.
Note that, while being convenient, this is less efficient than pre-allocating a
Record
and reading into it with the read
method, since every iteration involves
the allocation of a new Record
.
fn pileup(&self) -> Pileups
Iterator over pileups.
fn bgzf(&self) -> *mut Struct_BGZF
Return the BGZF struct
fn header(&self) -> &HeaderView
Return the header.
Provided Methods
fn seek(&self, offset: i64) -> Result<(), SeekError>
Seek to the given virtual offset in the file
fn tell(&self) -> i64
Report the current virtual offset
Implementors
impl Read for Reader
impl Read for IndexedReader