pub trait SeqDiffer {
type Ok;
type Err;
// Required methods
fn diff_element<T>(&mut self, a: &T, b: &T)
where T: Diff + ?Sized;
fn left_excess<T>(&mut self, a: &T)
where T: Diff + ?Sized;
fn right_excess<T>(&mut self, b: &T)
where T: Diff + ?Sized;
fn end(self) -> Result<Self::Ok, Self::Err>;
// Provided method
fn diff_elements<T, I>(&mut self, a: I, b: I)
where T: Diff,
I: IntoIterator<Item = T> { ... }
}
Expand description
A type that can do something with information about differences in a
sequence, like a slice or Vec
.
Required Associated Types§
Required Methods§
Sourcefn diff_element<T>(&mut self, a: &T, b: &T)
fn diff_element<T>(&mut self, a: &T, b: &T)
We’ve found elements in corresponding positions in both sequences.
Sourcefn left_excess<T>(&mut self, a: &T)
fn left_excess<T>(&mut self, a: &T)
We’ve found an element that only appears in the left-hand sequence.
Sourcefn right_excess<T>(&mut self, b: &T)
fn right_excess<T>(&mut self, b: &T)
We’ve found an element that only appears in the right-hand sequence.
Provided Methods§
Sourcefn diff_elements<T, I>(&mut self, a: I, b: I)where
T: Diff,
I: IntoIterator<Item = T>,
fn diff_elements<T, I>(&mut self, a: I, b: I)where
T: Diff,
I: IntoIterator<Item = T>,
Consumes two iterators, diffing their contents. This is a convenience method implemented in terms of the others.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.