noodles_cram::io::indexed_reader

Struct IndexedReader

Source
pub struct IndexedReader<R> { /* private fields */ }
Expand description

An indexed CRAM reader.

Implementations§

Source§

impl<R> IndexedReader<R>
where R: Read,

Source

pub fn new(inner: R, index: Index) -> Self

Creates an indexed CRAM reader.

Source

pub fn get_ref(&self) -> &R

Returns a reference to the underlying reader.

Source

pub fn get_mut(&mut self) -> &mut R

Returns a mutable reference to the underlying reader.

Source

pub fn into_inner(self) -> R

Unwraps and returns the underlying reader.

Source

pub fn reference_sequence_repository(&self) -> &Repository

Returns the reference sequence repository.

Source

pub fn read_file_definition(&mut self) -> Result<FileDefinition>

Reads the CRAM file definition.

Source

pub fn read_file_header(&mut self) -> Result<Header>

Reads the SAM header.

Source

pub fn read_header(&mut self) -> Result<Header>

Reads the SAM header.

Source

pub fn read_data_container(&mut self) -> Result<Option<DataContainer>>

Reads a data container.

Source

pub fn records<'r>(&'r mut self, header: &'r Header) -> Records<'r, R>

Returns a iterator over records starting from the current stream position.

Source

pub fn index(&self) -> &Index

Returns the associated index.

Source§

impl<R> IndexedReader<R>
where R: Read + Seek,

Source

pub fn query<'a>( &'a mut self, header: &'a Header, region: &Region, ) -> Result<Query<'a, R>>

Returns an iterator over records that intersects the given region.

Auto Trait Implementations§

§

impl<R> Freeze for IndexedReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for IndexedReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for IndexedReader<R>
where R: Send,

§

impl<R> Sync for IndexedReader<R>
where R: Sync,

§

impl<R> Unpin for IndexedReader<R>
where R: Unpin,

§

impl<R> UnwindSafe for IndexedReader<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.