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