Struct FastaSequence

Source
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>

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> FastaSequence<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for FastaSequence<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for FastaSequence<'a>

§

impl<'a> RefUnwindSafe for FastaSequence<'a>

§

impl<'a> Send for FastaSequence<'a>

§

impl<'a> Sync for FastaSequence<'a>

§

impl<'a> Unpin for FastaSequence<'a>

§

impl<'a> UnwindSafe for FastaSequence<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.