pub struct RecordBuffer { /* private fields */ }
Expand description
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.
Implementations§
Source§impl RecordBuffer
impl RecordBuffer
Sourcepub fn fetch(
&mut self,
chrom: &[u8],
start: u64,
end: u64,
) -> Result<(usize, usize)>
pub fn fetch( &mut self, chrom: &[u8], start: u64, end: u64, ) -> Result<(usize, usize)>
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.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, Record>
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
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for RecordBuffer
impl Debug for RecordBuffer
impl Send for RecordBuffer
impl Sync for RecordBuffer
Auto Trait Implementations§
impl Freeze for RecordBuffer
impl RefUnwindSafe for RecordBuffer
impl Unpin for RecordBuffer
impl UnwindSafe for RecordBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more