[][src]Struct rust_htslib::bcf::buffer::RecordBuffer

pub struct RecordBuffer { /* fields omitted */ }

A buffer for BCF records. This allows access regions in a sorted BCF 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 does not use any indexed random access. Hence, for getting a region at the very end of the BCF, you will have to wait until all records before have been read.

Methods

impl RecordBuffer[src]

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

Create new buffer.

pub fn fetch(
    &mut self,
    chrom: &[u8],
    start: u32,
    end: u32
) -> Result<(usize, usize)>
[src]

Fill the buffer with variants in the given window. The start coordinate has to be right of the start coordinate of any previous fill operation. Coordinates are 0-based, and end is exclusive. Returns tuple with numbers of added and deleted records compared to previous fetch.

pub fn iter(&self) -> Iter<Record>[src]

Iterate over records that have been fetched with fetch.

pub fn iter_mut(&mut self) -> IterMut<Record>[src]

Iterate over mutable references to records that have been fetched with fetch.

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl Send for RecordBuffer[src]

impl Sync for RecordBuffer[src]

impl Debug for RecordBuffer[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

type Error = !

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.

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

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

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