[][src]Trait seq_io::fasta::Record

pub trait Record {
    fn head(&self) -> &[u8];
fn seq(&self) -> &[u8];
fn write<W: Write>(&self, writer: W) -> Result<()>;
fn write_wrap<W: Write>(&self, writer: W, wrap: usize) -> Result<()>; 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> { ... } }

FASTA record trait implemented by both RefRecord and OwnedRecord

Required methods

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

Return the header line of the record as byte slice

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

Return the FASTA sequence as byte slice

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

Write the record to the given io::Write instance. The sequence will occupy one line only.

fn write_wrap<W: Write>(&self, writer: W, wrap: usize) -> Result<()>

Write the record to the given io::Write instance. The sequence is wrapped to produce multi-line FASTA with a maximum width specified by wrap.

Loading content...

Provided methods

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

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

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

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

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

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

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.

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.

Loading content...

Implementors

impl Record for OwnedRecord[src]

impl<'a> Record for RefRecord<'a>[src]

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

Return the FASTA sequence as byte slice. Note that this method of RefRecord returns the raw sequence, which may contain line breaks. Use seq_lines() to iterate over all lines without breaks, or use full_seq() to access the whole sequence at once.

Loading content...