pub struct FastaSequence<'a> {
pub description: &'a [u8],
/* private fields */
}
Expand description
A FASTA sequence with a description from a FASTA file. The sequence is not processed in any way, meaning accessing it performs further parsing when necessary.
Fields§
§description: &'a [u8]
A byte slice containing the sequence description (without the leading ‘>’ character, and without the trailing newline.
Implementations§
Source§impl<'a> FastaSequence<'a>
impl<'a> FastaSequence<'a>
Sourcepub fn iter(&self) -> impl Iterator<Item = &u8>
pub fn iter(&self) -> impl Iterator<Item = &u8>
Returns an iterator over the FASTA sequence characters, excluding newlines. Note that the parser expects unix-style line breaks, thus, CR-characters are preserved.
Newlines are filtered out on the fly, meaning that multiple calls to iter
repeatedly
search and skip them during iteration.
Sourcepub fn copy_sequential(&self) -> Box<[u8]>
pub fn copy_sequential(&self) -> Box<[u8]>
Copy the sequence into a consecutive memory region. This method allocates a buffer and copies the sequence into it, skipping newline symbols. Note that any other symbols (including whitespace and line feeds) get preserved. The capacity of the return value may be larger than the actual sequence. It is guaranteed, however, that only one allocation is performed.
Sourcepub fn size_hint(&self) -> usize
pub fn size_hint(&self) -> usize
Returns the maximum size in bytes this sequence occupies.
This size is a limit and could be smaller,
for example if newlines are filtered out of the sequence (see copy_sequential
)
Trait Implementations§
Source§impl<'a> Clone for FastaSequence<'a>
impl<'a> Clone for FastaSequence<'a>
Source§fn clone(&self) -> FastaSequence<'a>
fn clone(&self) -> FastaSequence<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more