[−][src]Trait seq_io::fasta::Record
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
.
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.
Implementors
impl Record for OwnedRecord
[src]
fn head(&self) -> &[u8]
[src]
fn seq(&self) -> &[u8]
[src]
fn write<W: Write>(&self, writer: W) -> Result<()>
[src]
fn write_wrap<W: Write>(&self, writer: W, wrap: usize) -> Result<()>
[src]
impl<'a> Record for RefRecord<'a>
[src]
fn head(&self) -> &[u8]
[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.