pub struct ReadStructure { /* private fields */ }
Expand description
The read structure composed of one or more ReadSegment
s.
Implementations§
Source§impl 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 ReadSegment
s. The offsets
for the ReadSegment
s are not updated.
Builds a new ReadStructure
from a vector of ReadSegment
s.
§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 ReadSegment
s 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 ReadSegment
s 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 ReadSegment
s 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 ReadSegment
s in this read structure
Sourcepub fn skips(&self) -> impl Iterator<Item = &ReadSegment>
pub fn skips(&self) -> impl Iterator<Item = &ReadSegment>
Returns the skip ReadSegment
s in this read structure
Sourcepub fn cellular_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
pub fn cellular_barcodes(&self) -> impl Iterator<Item = &ReadSegment>
Returns the cellular barcode ReadSegment
s 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§
Source§impl Clone for ReadStructure
impl Clone for ReadStructure
Source§fn clone(&self) -> ReadStructure
fn clone(&self) -> ReadStructure
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ReadStructure
impl Debug for ReadStructure
Source§impl Display for ReadStructure
impl Display for ReadStructure
Source§impl FromStr for ReadStructure
impl FromStr for ReadStructure
Source§impl Index<usize> for ReadStructure
impl Index<usize> for ReadStructure
Source§fn index(&self, idx: usize) -> &Self::Output
fn index(&self, idx: usize) -> &Self::Output
Returns the ReadSegment
at the given index in the read structure.
Source§type Output = ReadSegment
type Output = ReadSegment
Source§impl IntoIterator for ReadStructure
impl IntoIterator for ReadStructure
Source§impl PartialEq for ReadStructure
impl PartialEq for ReadStructure
Source§impl TryFrom<&[ReadSegment]> for ReadStructure
impl TryFrom<&[ReadSegment]> for ReadStructure
Source§fn 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.