pub struct SequenceMatcher<'a, T: Eq + Hash> { /* private fields */ }Expand description
SequenceMatcher(None, a, b, autojunk): finds the longest matching blocks
of two sequences, recursively.
Implementations§
Source§impl<'a, T: Eq + Hash> SequenceMatcher<'a, T>
impl<'a, T: Eq + Hash> SequenceMatcher<'a, T>
Sourcepub fn new(a: &'a [T], b: &'a [T], autojunk: bool) -> Self
pub fn new(a: &'a [T], b: &'a [T], autojunk: bool) -> Self
SequenceMatcher(None, a, b, autojunk=autojunk).
Sourcepub fn find_longest_match(
&self,
alo: usize,
ahi: usize,
blo: usize,
bhi: usize,
) -> Match
pub fn find_longest_match( &self, alo: usize, ahi: usize, blo: usize, bhi: usize, ) -> Match
find_longest_match(alo, ahi, blo, bhi): the longest matching block in
a[alo..ahi] and b[blo..bhi], the earliest in a, then in b; then
extended by the popular elements around it.
Sourcepub fn get_matching_blocks(&self) -> Vec<Match>
pub fn get_matching_blocks(&self) -> Vec<Match>
get_matching_blocks: the matching blocks, increasing in a and b,
adjacent ones collapsed, ending with (len(a), len(b), 0).
Sourcepub fn get_opcodes(&self) -> Vec<Opcode>
pub fn get_opcodes(&self) -> Vec<Opcode>
get_opcodes: how to turn a into b.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Forget for SequenceMatcher<'a, T>
impl<'a, T> Freeze for SequenceMatcher<'a, T>
impl<'a, T> Move for SequenceMatcher<'a, T>
impl<'a, T> RefUnwindSafe for SequenceMatcher<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SequenceMatcher<'a, T>
impl<'a, T> Sync for SequenceMatcher<'a, T>
impl<'a, T> Unpin for SequenceMatcher<'a, T>
impl<'a, T> UnsafeUnpin for SequenceMatcher<'a, T>where
&'a [T]: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(&'a T, Vec<usize>)>: UnsafeUnpin,
impl<'a, T> UnwindSafe for SequenceMatcher<'a, T>
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