pub struct Chunk {
pub id: String,
pub document_id: String,
pub chunk_index: i64,
pub text: String,
pub hash: String,
}Expand description
A chunk of a document’s body text, stored in the chunks table.
Documents are split into chunks by the crate::chunk module to enable
granular retrieval and embedding. Each chunk has:
- A deterministic UUID (derived from document_id + chunk_index)
- A contiguous
chunk_indexstarting at 0 - A SHA-256
hashof its text content, used by the embedding pipeline to detect when re-embedding is needed (staleness detection)
Fields§
§id: StringUUID v4 primary key.
document_id: StringForeign key to the parent Document.
chunk_index: i64Zero-based index within the document’s chunk sequence.
text: StringChunk text content.
hash: StringSHA-256 hash of text, used for embedding staleness detection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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