pub enum Dedup {
Hash,
Eq,
}Expand description
HOW a retrieve tells two of this index’s keys apart — the dedup(…) word.
A retrieve dedupes the engine’s hit stream BY KEY, first sighting winning, because the store faces are open traits and no backend owes uniqueness across the sources sharing a slot. What a declaration chooses here is not whether that happens; it is the MECHANISM, and the mechanism is a BOUNDS choice on the key type:
| word | the emitted method names | the key must satisfy |
|---|---|---|
dedup(hash) | HashSeen | Hash + Eq |
dedup(eq) | EqSeen | PartialEq |
A CLOSED unit enum, because the vocabulary is the FRAMEWORK’s: each word names one of the
framework’s own membership implementations, and a fourth mechanism is an arm here plus an
implementor there rather than a redesign. That is the crate’s rule for a framework-owned
vocabulary, and the open surface is one level down — a third party’s KEY joins by implementing
Hash or PartialEq, which it already does.
Hash is the default when the word is absent: every key a node macro emits today
is built from the closed segment vocabulary and every member of it hashes, so the default always
compiles. eq is the escape for a key that cannot — a float in an address, a foreign type with
no Hash impl — and it asks less of the type, which is why the choice is declared rather than
fixed.
Variants§
Hash
dedup(hash) — membership through a HashSet.
Eq
dedup(eq) — membership through a list walked by field-wise equality.