Struct rust_htslib::bam::buffer::RecordBuffer [−][src]
pub struct RecordBuffer { /* fields omitted */ }
A buffer for BAM records. This allows access regions in a sorted BAM file while iterating over it in a single pass. The buffer is implemented as a ringbuffer, such that extension or movement to the right has linear complexity. The buffer makes use of indexed random access. Hence, when fetching a region at the very end of the BAM, everything before is omitted without cost.
Methods
impl RecordBuffer
[src]
impl RecordBuffer
pub fn new(bam: IndexedReader) -> Self
[src]
pub fn new(bam: IndexedReader) -> Self
Create a new RecordBuffer
.
pub fn fetch(
&mut self,
chrom: &[u8],
start: u32,
end: u32
) -> Result<(usize, usize), Box<Error>>
[src]
pub fn fetch(
&mut self,
chrom: &[u8],
start: u32,
end: u32
) -> Result<(usize, usize), Box<Error>>
Fill buffer at the given interval. If the start coordinate is left of the previous start coordinate, this will use an additional BAM fetch IO operation. Coordinates are 0-based, and end is exclusive. Returns tuple with numbers of added and deleted records since the previous fetch.
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<Record>
[src]
pub fn iter(&self) -> Iter<Record>
Iterate over records that have been fetched with fetch
.
ⓘImportant traits for IterMut<'a, T>pub fn iter_mut(&mut self) -> IterMut<Record>
[src]
pub fn iter_mut(&mut self) -> IterMut<Record>
Iterate over mutable references to records that have been fetched with fetch
.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Trait Implementations
impl Debug for RecordBuffer
[src]
impl Debug for RecordBuffer
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Sync for RecordBuffer
[src]
impl Sync for RecordBuffer
impl Send for RecordBuffer
[src]
impl Send for RecordBuffer