[][src]Struct bam::sam::SamReader

pub struct SamReader<R: BufRead> { /* fields omitted */ }

Reads records from SAM format.

Can be opened as

let reader = SamReader::from_path("in.sam").unwrap();

You can iterate over records:

let mut reader = bam::SamReader::from_path("in.sam").unwrap();
for record in reader {
    let record = record.unwrap();
    // Do something.
}

You can use RecordReader trait to read records without excess allocation.

Methods

impl SamReader<BufReader<File>>[src]

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Opens SAM reader from path.

impl<R: BufRead> SamReader<R>[src]

pub fn from_stream(stream: R) -> Result<Self>[src]

Opens SAM reader from a buffered stream.

pub fn header(&self) -> &Header[src]

Returns header.

Trait Implementations

impl<R: BufRead> RecordReader for SamReader<R>[src]

impl<R: BufRead> Iterator for SamReader<R>[src]

Iterator over records.

Errors

If the record was corrupted, the function returns Corrupted error. If the record was truncated or the reading failed for a different reason, the function returns Truncated error.

type Item = Result<Record, Error>

The type of the elements being iterated over.

Auto Trait Implementations

impl<R> Send for SamReader<R> where
    R: Send

impl<R> Unpin for SamReader<R> where
    R: Unpin

impl<R> Sync for SamReader<R> where
    R: Sync

impl<R> UnwindSafe for SamReader<R> where
    R: UnwindSafe

impl<R> RefUnwindSafe for SamReader<R> where
    R: RefUnwindSafe

Blanket Implementations

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

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

type Error = Infallible

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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