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

replaces self.before wtih the iterned Tokens yielded by input Note that this does not erase any tokens from the interner and might therefore be considered a memory leak. If this function is called often over a long_running process consider clearing the interner with clear.

replaces self.before wtih the iterned Tokens yielded by input Note that this does not erase any tokens from the interner and might therefore be considered a memory leak. If this function is called often over a long_running process consider clearing the interner with clear or erase_tokens_after.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.