pub struct SequenceMatcher {
a: Vec<char>,
b: Vec<char>,
b2j: HashMap<char, Vec<usize>>,
}Expand description
difflib.SequenceMatcher(None, a, b) over character sequences.
Fields§
§a: Vec<char>§b: Vec<char>§b2j: HashMap<char, Vec<usize>>Each char of b to the indices where it occurs, in order.
Implementations§
Source§impl SequenceMatcher
impl SequenceMatcher
pub fn new(a: &str, b: &str) -> SequenceMatcher
Sourcefn find_longest_match(
&self,
alo: usize,
ahi: usize,
blo: usize,
bhi: usize,
) -> (usize, usize, usize)
fn find_longest_match( &self, alo: usize, ahi: usize, blo: usize, bhi: usize, ) -> (usize, usize, usize)
find_longest_match(alo, ahi, blo, bhi). With no isjunk the
junk set is empty, so only CPython’s first pair of extension passes
can move — and they do, over popular elements autojunk dropped.
Sourcefn total_matches(&self) -> usize
fn total_matches(&self) -> usize
Total size of all matching blocks — everything ratio needs.
Auto Trait Implementations§
impl Freeze for SequenceMatcher
impl RefUnwindSafe for SequenceMatcher
impl Send for SequenceMatcher
impl Sync for SequenceMatcher
impl Unpin for SequenceMatcher
impl UnsafeUnpin for SequenceMatcher
impl UnwindSafe for SequenceMatcher
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