Struct noodles_sam::record::Cigar
source · pub struct Cigar<'a>(/* private fields */);
Expand description
Raw SAM record CIGAR operations.
Implementations§
source§impl<'a> Cigar<'a>
impl<'a> Cigar<'a>
sourcepub fn new(src: &'a [u8]) -> Self
pub fn new(src: &'a [u8]) -> Self
Creates SAM record CIGAR operations.
§Examples
use noodles_sam::record::Cigar;
let cigar = Cigar::new(b"8M13N");
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether there are any CIGAR operations.
§Examples
use noodles_sam::record::Cigar;
let cigar = Cigar::new(b"");
assert!(cigar.is_empty());
let cigar = Cigar::new(b"8M13N");
assert!(!cigar.is_empty());
sourcepub fn iter(&self) -> impl Iterator<Item = Result<Op, ParseError>> + '_
pub fn iter(&self) -> impl Iterator<Item = Result<Op, ParseError>> + '_
Returns an iterator over CIGAR operations.
§Examples
use noodles_sam::{
alignment::record::cigar::{op::Kind, Op},
record::Cigar,
};
let cigar = Cigar::new(b"");
assert!(cigar.iter().next().is_none());
let cigar = Cigar::new(b"8M13N");
let mut iter = cigar.iter();
assert_eq!(iter.next().transpose()?, Some(Op::new(Kind::Match, 8)));
assert_eq!(iter.next().transpose()?, Some(Op::new(Kind::Skip, 13)));
assert!(iter.next().is_none());
Trait Implementations§
source§impl<'a> Cigar for Cigar<'a>
impl<'a> Cigar for Cigar<'a>
source§impl<'a> PartialEq for Cigar<'a>
impl<'a> PartialEq for Cigar<'a>
impl<'a> Eq for Cigar<'a>
impl<'a> StructuralPartialEq for Cigar<'a>
Auto Trait Implementations§
impl<'a> Freeze for Cigar<'a>
impl<'a> RefUnwindSafe for Cigar<'a>
impl<'a> Send for Cigar<'a>
impl<'a> Sync for Cigar<'a>
impl<'a> Unpin for Cigar<'a>
impl<'a> UnwindSafe for Cigar<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.