Function similar::algorithms::diff_deadline
source · pub fn diff_deadline<Old, New, D>(
alg: Algorithm,
d: &mut D,
old: &Old,
old_range: Range<usize>,
new: &New,
new_range: Range<usize>,
deadline: Option<Instant>
) -> Result<(), D::Error>
Expand description
Creates a diff between old and new with the given algorithm with deadline.
Diffs old
, between indices old_range
and new
between indices new_range
.
This diff is done with an optional deadline that defines the maximal execution time permitted before it bails and falls back to an approximation. Note that not all algorithms behave well if they reach the deadline (LCS for instance produces a very simplistic diff when the deadline is reached in all cases).