Struct read_structure::ReadStructure
source · [−]pub struct ReadStructure { /* private fields */ }Expand description
The read structure composed of one or more ReadSegments.
Implementations
sourceimpl ReadStructure
impl ReadStructure
sourcepub fn new(segments: Vec<ReadSegment>) -> Result<Self, ReadStructureError>
pub fn new(segments: Vec<ReadSegment>) -> Result<Self, ReadStructureError>
Builds a new ReadStructure from a vector of ReadSegments. The offsets
for the ReadSegments are not updated.
Builds a new ReadStructure from a vector of ReadSegments.
Errors
Returns Err if the any segment but the last has an indefinite length, or no elements
exist.
sourcepub fn has_fixed_length(&self) -> bool
pub fn has_fixed_length(&self) -> bool
Returns true if the ReadStructure has a fixed (i.e. non-variable) length,
false if there are segments but no fixed length.
sourcepub fn fixed_length(&self) -> Option<usize>
pub fn fixed_length(&self) -> Option<usize>
Returns the fixed length if there is one.
sourcepub fn number_of_segments(&self) -> usize
pub fn number_of_segments(&self) -> usize
Returns the number of segments in this read structure.
sourcepub fn segments(&self) -> &[ReadSegment]
pub fn segments(&self) -> &[ReadSegment]
Returns the underlying elements in this read structure.
sourcepub fn iter(&self) -> impl Iterator<Item = &ReadSegment>
pub fn iter(&self) -> impl Iterator<Item = &ReadSegment>
Returns an iterator over the read segments
sourcepub fn segments_by_type(
&self,
kind: SegmentType
) -> impl Iterator<Item = &ReadSegment>
pub fn segments_by_type(
&self,
kind: SegmentType
) -> impl Iterator<Item = &ReadSegment>
Returns the ReadSegments in this read structure of the given kind.
sourcepub fn templates(&self) -> impl Iterator<Item = &ReadSegment>
pub fn templates(&self) -> impl Iterator<Item = &ReadSegment>
Returns the template ReadSegments in this read structure
sourcepub fn sample_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
pub fn sample_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
Returns the sample barcode ReadSegments in this read structure
sourcepub fn molecular_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
pub fn molecular_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
Returns the molecular barcode ReadSegments in this read structure
sourcepub fn skips(&self) -> impl Iterator<Item = &ReadSegment>
pub fn skips(&self) -> impl Iterator<Item = &ReadSegment>
Returns the skip ReadSegments in this read structure
sourcepub fn first(&self) -> Option<&ReadSegment>
pub fn first(&self) -> Option<&ReadSegment>
Returns the first ReadSegment in this read structure
sourcepub fn last(&self) -> Option<&ReadSegment>
pub fn last(&self) -> Option<&ReadSegment>
Returns the last ReadSegment in this read structure
Trait Implementations
sourceimpl Clone for ReadStructure
impl Clone for ReadStructure
sourcefn clone(&self) -> ReadStructure
fn clone(&self) -> ReadStructure
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ReadStructure
impl Debug for ReadStructure
sourceimpl Display for ReadStructure
impl Display for ReadStructure
sourceimpl FromStr for ReadStructure
impl FromStr for ReadStructure
sourceimpl Index<usize> for ReadStructure
impl Index<usize> for ReadStructure
sourcefn index(&self, idx: usize) -> &Self::Output
fn index(&self, idx: usize) -> &Self::Output
Returns the ReadSegment at the given index in the read structure.
type Output = ReadSegment
type Output = ReadSegment
The returned type after indexing.
sourceimpl IntoIterator for ReadStructure
impl IntoIterator for ReadStructure
sourceimpl TryFrom<&'_ [ReadSegment]> for ReadStructure
impl TryFrom<&'_ [ReadSegment]> for ReadStructure
sourcefn try_from(elements: &[ReadSegment]) -> Result<Self, Self::Error>
fn try_from(elements: &[ReadSegment]) -> Result<Self, Self::Error>
Builds a new read structure from a slice of elements.
type Error = ReadStructureError
type Error = ReadStructureError
The type returned in the event of a conversion error.
Auto Trait Implementations
impl RefUnwindSafe for ReadStructure
impl Send for ReadStructure
impl Sync for ReadStructure
impl Unpin for ReadStructure
impl UnwindSafe for ReadStructure
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more