Struct seq_io::fasta::RefRecord [−][src]
pub struct RefRecord<'a> { /* fields omitted */ }
A FASTA record that borrows data from a buffer.
Methods
impl<'a> RefRecord<'a>
[src]
impl<'a> RefRecord<'a>
ⓘImportant traits for SeqLines<'a>pub fn seq_lines(&self) -> SeqLines
[src]
pub fn seq_lines(&self) -> SeqLines
Return an iterator over all sequence lines in the data
pub fn num_seq_lines(&self) -> usize
[src]
pub fn num_seq_lines(&self) -> usize
Returns the number of sequence lines
pub fn full_seq(&self) -> Cow<[u8]>
[src]
pub fn full_seq(&self) -> Cow<[u8]>
Returns the full sequence. If the sequence consists of a single line,
then the sequence will be borrowed from the underlying buffer
(equivalent to calling RefRecord::seq()
). If there are multiple
lines, an owned copy will be created (equivalent to RefRecord::owned_seq()
).
pub fn owned_seq(&self) -> Vec<u8>
[src]
pub fn owned_seq(&self) -> Vec<u8>
Returns the sequence as owned Vec
. Note: This function
must be called in order to obtain a sequence that does not contain
line endings (as returned by seq()
)
pub fn to_owned_record(&self) -> OwnedRecord
[src]
pub fn to_owned_record(&self) -> OwnedRecord
Creates an owned copy of the record.
pub fn write_unchanged<W: Write>(&self, writer: &mut W) -> Result<()>
[src]
pub fn write_unchanged<W: Write>(&self, writer: &mut W) -> Result<()>
Writes a record to the given io::Write
instance
by just writing the unmodified input, which is faster than RefRecord::write
Trait Implementations
impl<'a> Debug for RefRecord<'a>
[src]
impl<'a> Debug for RefRecord<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Clone for RefRecord<'a>
[src]
impl<'a> Clone for RefRecord<'a>
fn clone(&self) -> RefRecord<'a>
[src]
fn clone(&self) -> RefRecord<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> Record for RefRecord<'a>
[src]
impl<'a> Record for RefRecord<'a>
fn head(&self) -> &[u8]
[src]
fn head(&self) -> &[u8]
Return the header line of the record as byte slice
fn seq(&self) -> &[u8]
[src]
fn seq(&self) -> &[u8]
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.
fn write<W: Write>(&self, writer: &mut W) -> Result<()>
[src]
fn write<W: Write>(&self, writer: &mut 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: &mut W, wrap: usize) -> Result<()>
[src]
fn write_wrap<W: Write>(&self, writer: &mut 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
. Read more
fn id_bytes(&self) -> &[u8]
[src]
fn id_bytes(&self) -> &[u8]
fn id(&self) -> Result<&str, Utf8Error>
[src]
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]>
[src]
fn desc_bytes(&self) -> Option<&[u8]>
fn desc(&self) -> Option<Result<&str, Utf8Error>>
[src]
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]>)
[src]
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. Read more
fn id_desc(&self) -> Result<(&str, Option<&str>), Utf8Error>
[src]
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. Read more