pub struct Op { /* private fields */ }
Expand description
A SAM record CIGAR operation.
Implementations
sourceimpl Op
impl Op
sourcepub fn new(kind: Kind, len: u32) -> Self
pub fn new(kind: Kind, len: u32) -> Self
Creates a CIGAR operation.
Examples
use noodles_sam::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::record::cigar::{op::Kind, Op};
let op = Op::new(Kind::Match, 13);
assert_eq!(op.kind(), Kind::Match);
sourcepub fn len(self) -> u32
pub fn len(self) -> u32
Returns the length of the operation.
Examples
use noodles_sam::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::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
impl Copy for Op
impl Eq for Op
impl StructuralEq for Op
impl StructuralPartialEq for Op
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more