pub trait Operation<T>: Clone + Debug + Eq + Hash {
    fn backtrack(
        &self,
        seq_pair: &SeqPair<'_, T>,
        source_idx: usize,
        target_idx: usize
    ) -> Option<(usize, usize)>; fn cost(
        &self,
        seq_pair: &SeqPair<'_, T>,
        cost_matrix: &[Vec<usize>],
        source_idx: usize,
        target_idx: usize
    ) -> Option<usize>
    where
        T: Eq
; }
Expand description

Trait for sequence edit operations.

Required Methods

Return the cell after backtracking from the given cell with this operation.

Must return None if backtracking is not possible (e.g. would lead to an invalid cell). This method is used for the construction of traces and edit scripts.

Compute the cost after applying the operation.

Returns None if the operation cannot be applied. Otherwise, it returns the cost for the alignment at source_idx, target_idx using this operation.

Implementors