pub struct DocId(pub u64);Expand description
Canonical document identity consumed by the fusion kernel.
A newtype (rather than a bare u64) so a retrieval-space document id can
never be silently confused with a raw vector offset, record id, or rank.
The fusion kernel keys exclusively on this type; executors convert their
native ids into a DocId at the boundary.
§Identity-space contract (Task 1)
DocId is the retrieval-universe identity, a dense u64 shared by
every lane that participates in pre-filtered fusion:
| Lane | Native key | Relationship to DocId |
|---|---|---|
| BM25 / inverted index | u64 doc id | identical (DocId(id)) |
| Grep / trigram lane | DocId = u64 alias | identical |
AllowedSet membership | u64 | identical (AllowedSet::contains(d.get())) |
| HNSW vector graph | u128 storage id | mapped at the boundary |
The first three are the same key space, so an AllowedSet produced by one
lane gates every other lane with an O(1) membership test on DocId.0. The
HNSW graph keys on a wider u128 storage id; the vector executor narrows
that to a retrieval DocId when it emits candidates (and accepts an
allowed(u128) predicate over the same mapping — see
HnswIndex::search_allowed). Threading the newtype down into the u128
storage layer is deliberately out of scope here: it touches the durable
id space and yields no behavioral change while this kernel keys on DocId.
Tuple Fields§
§0: u64Implementations§
Trait Implementations§
impl Copy for DocId
impl Eq for DocId
Source§impl Ord for DocId
impl Ord for DocId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for DocId
impl PartialOrd for DocId
impl StructuralPartialEq for DocId
Auto Trait Implementations§
impl Freeze for DocId
impl RefUnwindSafe for DocId
impl Send for DocId
impl Sync for DocId
impl Unpin for DocId
impl UnsafeUnpin for DocId
impl UnwindSafe for DocId
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more