pub struct Query<'r, 'h: 'r, R> { /* private fields */ }Expand description
A reader over records of a SAM reader that intersects a given region.
This is created by calling Reader::query.
Implementations§
Source§impl<'r, 'h: 'r, R> Query<'r, 'h, R>
impl<'r, 'h: 'r, R> Query<'r, 'h, R>
Sourcepub fn read_record(&mut self, record: &mut Record) -> Result<usize>
pub fn read_record(&mut self, record: &mut Record) -> Result<usize>
Reads a record.
§Example
use noodles_bgzf as bgzf;
use noodles_csi as csi;
use noodles_sam as sam;
let mut reader = File::open("sample.sam.gz")
.map(bgzf::io::Reader::new)
.map(sam::io::Reader::new)?;
let header = reader.read_header()?;
let index = csi::fs::read("sample.sam.gz.csi")?;
let region = "sq0:8-13".parse()?;
let mut query = reader.query(&header, &index, ®ion)?;
let mut record = sam::Record::default();
while query.read_record(&mut record)? != 0 {
// ...
}Auto Trait Implementations§
impl<'r, 'h, R> !UnwindSafe for Query<'r, 'h, R>
impl<'r, 'h, R> Freeze for Query<'r, 'h, R>
impl<'r, 'h, R> RefUnwindSafe for Query<'r, 'h, R>where
R: RefUnwindSafe,
impl<'r, 'h, R> Send for Query<'r, 'h, R>where
R: Send,
impl<'r, 'h, R> Sync for Query<'r, 'h, R>where
R: Sync,
impl<'r, 'h, R> Unpin for Query<'r, 'h, R>
impl<'r, 'h, R> UnsafeUnpin for Query<'r, 'h, R>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more