pub fn query<'r, 'h>(
        &'r mut self,
        header: &'h Header,
        index: &tabix::Index,
        region: &Region,
    ) -> io::Result<Query<'r, 'h, R>> {
        let (reference_sequence_id, reference_sequence_name, interval) =
            resolve_region(index, region)?;

        let chunks = index.query(reference_sequence_id, interval)?;

        Ok(Query::new(
            self,
            chunks,
            reference_sequence_name,
            interval,
            header,
        ))
    }
/// Returns an iterator over records that intersects the given region.
///
/// # Examples
///
/// ```no_run
/// # use std::fs::File;
/// use noodles_bgzf as bgzf;;
/// use noodles_core::Region;
/// use noodles_tabix as tabix;
/// use noodles_vcf as vcf;
///
/// let mut reader = File::open("sample.vcf.gz")
///     .map(bgzf::Reader::new)
///     .map(vcf::Reader::new)?;
///
/// let header = reader.read_header()?.parse()?;
///
/// let index = tabix::read("sample.vcf.gz.tbi")?;
/// let region = Region::mapped("sq0", 8..=13);
/// let query = reader.query(&header, &index, &region)?;
///
/// for result in query {
///     let record = result?;
///     println!("{:?}", record);
/// }
/// Ok::<_, Box<dyn std::error::Error>>(())
/// ```
Returns an iterator over records that intersects the given region.
Returns an iterator over records that intersects the given region .
pub fn query<'r, 'h>(
        &'r mut self,
        header: &'h Header,
        index: &tabix::Index,
        region: &Region,
    ) -> io::Result<Query<'r, 'h, R>> {
        let (reference_sequence_id, reference_sequence_name, interval) =
            resolve_region(index, region)?;
        let chunks = index.query(reference_sequence_id, interval)?;
        Ok(Query::new(
            self,
            chunks,
            reference_sequence_name,
            interval,
            header,
        ))
    }
pub fn query < ' r , ' h > ( & ' r mut self , header : & ' h Header , index : & tabix :: Index , region : & Region , ) -> io :: Result < Query < ' r , ' h , R > > { let ( reference_sequence_id , reference_sequence_name , interval ) = resolve_region ( index , region ) ? ; let chunks = index . query ( reference_sequence_id , interval ) ? ; Ok ( Query :: new ( self , chunks , reference_sequence_name , interval , header , ) ) }
Returns an iterator over records that intersects the given region.
Returns an iterator over records that intersects the given region .
&'r mut self
header
&'h Header
index
&tabix::Index
region
&Region
&'r mut self
header
&'h Header
index
&tabix::Index
region
&Region
examples
None
use std::fs::file;


let mut reader = File::open("sample.vcf.gz")
.map(bgzf::Reader::new)
.map(vcf::Reader::new)?.

let header = reader.read_header()?.parse()?.

let index = tabix::read("sample.vcf.gz.tbi")?;
let region = Region::mapped("sq0", 8..=13);
let query = reader.query(&header, &index, &region)?.


let mut reader = File :: open ( " sample . vcf . gz " ) . map ( bgzf :: Reader :: new ) . map ( vcf :: Reader :: new ) ? . let header = reader . read_header () ? . parse () ? . let index = tabix :: read ( " sample . vcf . gz . tbi " ) ? ; let region = Region :: mapped ( " sq0 " 8 .. = 13 ) ; let query = reader . query ( &header &index &region ) ? .