Trait Record

Source
pub trait Record {
    // Required methods
    fn head(&self) -> &[u8] ;
    fn seq(&self) -> &[u8] ;
    fn qual(&self) -> &[u8] ;

    // Provided methods
    fn id_bytes(&self) -> &[u8]  { ... }
    fn id(&self) -> Result<&str, Utf8Error> { ... }
    fn desc_bytes(&self) -> Option<&[u8]> { ... }
    fn desc(&self) -> Option<Result<&str, Utf8Error>> { ... }
    fn id_desc_bytes(&self) -> (&[u8], Option<&[u8]>) { ... }
    fn id_desc(&self) -> Result<(&str, Option<&str>), Utf8Error> { ... }
    fn write<W: Write>(&self, writer: W) -> Result<()> { ... }
}
Expand description

FASTQ record trait implemented by both RefRecord and OwnedRecord

Required Methods§

Source

fn head(&self) -> &[u8]

Return the header line of the record as byte slice

Source

fn seq(&self) -> &[u8]

Return the FASTQ sequence as byte slice

Source

fn qual(&self) -> &[u8]

Return the FASTQ qualities as byte slice

Provided Methods§

Source

fn id_bytes(&self) -> &[u8]

Source

fn id(&self) -> Result<&str, Utf8Error>

Return the ID of the record (everything before an optional space) as string slice

Source

fn desc_bytes(&self) -> Option<&[u8]>

Source

fn desc(&self) -> Option<Result<&str, Utf8Error>>

Return the description of the record as string slice, if present. Otherwise, None is returned.

Source

fn id_desc_bytes(&self) -> (&[u8], Option<&[u8]>)

Return both the ID and the description of the record (if present) This should be faster than calling id() and desc() separately.

Source

fn id_desc(&self) -> Result<(&str, Option<&str>), Utf8Error>

Return both the ID and the description of the record (if present) This should be faster than calling id() and desc() separately.

Source

fn write<W: Write>(&self, writer: W) -> Result<()>

Writes a record to the given io::Write instance

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§