#[non_exhaustive]pub struct Lineage {
pub parent_id: DocumentId,
pub chunk_index: u32,
pub total_chunks: u32,
pub splitter: String,
pub chunker_chain: Vec<String>,
}Expand description
Split-history — survives every transformation. A leaf chunk’s
Lineage describes which parent it came from, which split
produced it, and which chunkers ran over it. Audit / debug
flows reconstruct the path from a retrieval hit back to the
ingestion source by walking the lineage chain (parent_id →
loader’s source URI).
None on the original Document produced by a DocumentLoader
— only chunked descendants carry lineage.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent_id: DocumentIdDocument id of the parent this chunk descends from. Walks up through every split layer to the original loaded document.
chunk_index: u32Position of this chunk within the immediate parent’s split output. Zero-based.
total_chunks: u32Total number of chunks the parent produced. Lets retrieval surfaces show “chunk 3 of 12” provenance.
splitter: StringStable identifier of the splitter that produced this
chunk. "recursive-character", "markdown-structure",
etc. — surfaces in audit dashboards.
chunker_chain: Vec<String>Stable identifiers of every chunker that processed this
chunk after the split, in order. "contextual",
"hyde", … — empty when no chunker ran.
Implementations§
Source§impl Lineage
impl Lineage
Sourcepub fn from_split(
parent_id: DocumentId,
chunk_index: u32,
total_chunks: u32,
splitter: impl Into<String>,
) -> Self
pub fn from_split( parent_id: DocumentId, chunk_index: u32, total_chunks: u32, splitter: impl Into<String>, ) -> Self
Build the lineage entry a splitter stamps onto each child
chunk. The chunker chain starts empty; downstream chunkers
append themselves via Self::push_chunker.
Sourcepub fn push_chunker(&mut self, chunker: impl Into<String>)
pub fn push_chunker(&mut self, chunker: impl Into<String>)
Append a chunker identifier to this chunk’s chain — called
by Chunker impls when they transform a chunk.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lineage
impl<'de> Deserialize<'de> for Lineage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Lineage
impl StructuralPartialEq for Lineage
Auto Trait Implementations§
impl Freeze for Lineage
impl RefUnwindSafe for Lineage
impl Send for Lineage
impl Sync for Lineage
impl Unpin for Lineage
impl UnsafeUnpin for Lineage
impl UnwindSafe for Lineage
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<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