Struct imara_diff::intern::InternedInput
source · [−]pub struct InternedInput<T: Eq + Hash> {
pub before: Vec<Token>,
pub after: Vec<Token>,
pub interner: Interner<T>,
}
Expand description
Two lists of interned tokens that can be compared with the diff
function.
A token represents the smallest possible unit of change during a diff. For text this is usually a line, a word or a single character. All algorithms operate on interned tokens instead of using the token data directly. This allows for much better performance by amortizing the cost hashing/equality.
While you can intern tokens yourself it is strongly recommended to use InternedInput
module.
Fields
before: Vec<Token>
after: Vec<Token>
interner: Interner<T>
Implementations
sourceimpl<T: Eq + Hash> InternedInput<T>
impl<T: Eq + Hash> InternedInput<T>
pub fn new<I: TokenSource<Token = T>>(before: I, after: I) -> Self
pub fn update_before(&mut self, file: impl Iterator<Item = T>)
pub fn update_after(&mut self, file: impl Iterator<Item = T>)
pub fn clear(&mut self)
Trait Implementations
sourceimpl<T: Default + Eq + Hash> Default for InternedInput<T>
impl<T: Default + Eq + Hash> Default for InternedInput<T>
sourcefn default() -> InternedInput<T>
fn default() -> InternedInput<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for InternedInput<T>where
T: RefUnwindSafe,
impl<T> Send for InternedInput<T>where
T: Send,
impl<T> Sync for InternedInput<T>where
T: Sync,
impl<T> Unpin for InternedInput<T>where
T: Unpin,
impl<T> UnwindSafe for InternedInput<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more