pub struct ReadSegment {
pub length: Option<usize>,
pub kind: SegmentType,
}Expand description
A single segment of a read structure: a segment type and an optional fixed length.
Segments are typically obtained by parsing a ReadStructure; the positions of the
segment’s bases within a read are tracked by the enclosing ReadStructure, not
here.
Fields§
§length: Option<usize>The optional length of this segment. None means this is the indefinite-length
(+) segment; its concrete span is resolved by the enclosing ReadStructure
at extract time (it runs from just after the preceding segments up to just
before the following segments, so in 8B+M10T the +M segment covers
everything between byte 8 and read_len - 10). At most one segment per read
structure may be indefinite.
kind: SegmentTypeThe segment type.
Implementations§
Source§impl ReadSegment
impl ReadSegment
Trait Implementations§
Source§impl Clone for ReadSegment
impl Clone for ReadSegment
Source§fn clone(&self) -> ReadSegment
fn clone(&self) -> ReadSegment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReadSegment
impl Debug for ReadSegment
Source§impl Display for ReadSegment
impl Display for ReadSegment
Source§impl FromStr for ReadSegment
impl FromStr for ReadSegment
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Builds a ReadSegment from a string representation. The character representation
of SegmentType must be the last character, while the leading character(s) either
a non-zero integer, or the any-length character.
§Errors
Returns Err if the string was too short, if the length could not be parsed, or if
the segment type could not be recognized.