pub struct Op { /* private fields */ }
Expand description
An alignment record CIGAR operation.
Implementations§
source§impl Op
impl Op
sourcepub const fn new(kind: Kind, len: usize) -> Self
pub const fn new(kind: Kind, len: usize) -> Self
Creates a CIGAR operation.
§Examples
use noodles_sam::alignment::record::cigar::{op::Kind, Op};
let op = Op::new(Kind::Match, 13);
assert_eq!(op.kind(), Kind::Match);
assert_eq!(op.len(), 13);
sourcepub fn kind(self) -> Kind
pub fn kind(self) -> Kind
Returns the kind of the operation.
§Examples
use noodles_sam::alignment::record::cigar::{op::Kind, Op};
let op = Op::new(Kind::Match, 13);
assert_eq!(op.kind(), Kind::Match);
sourcepub fn len(self) -> usize
pub fn len(self) -> usize
Returns the length of the operation.
§Examples
use noodles_sam::alignment::record::cigar::{op::Kind, Op};
let op = Op::new(Kind::Match, 13);
assert_eq!(op.len(), 13);
sourcepub fn is_empty(self) -> bool
pub fn is_empty(self) -> bool
Returns whether the operation is a no-op.
That is, whether the operation has a length of 0.
§Examples
use noodles_sam::alignment::record::cigar::{op::Kind, Op};
let op = Op::new(Kind::Match, 0);
assert!(op.is_empty());
let op = Op::new(Kind::Match, 13);
assert!(!op.is_empty());
Trait Implementations§
source§impl Extend<Op> for Cigar
impl Extend<Op> for Cigar
source§fn extend<T: IntoIterator<Item = Op>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Op>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl FromIterator<Op> for Cigar
impl FromIterator<Op> for Cigar
impl Copy for Op
impl Eq for Op
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnwindSafe for Op
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.