pub struct Chunk {
pub index: usize,
pub url: Option<String>,
pub title: Option<String>,
pub heading_path: Vec<String>,
pub markdown: String,
pub text: String,
pub tokens: usize,
pub units: Vec<usize>,
}Expand description
A run of units, sized for embedding.
Fields§
§index: usizeStable within one article: {position of first unit}.
url: Option<String>Source URL, carried so a retrieved chunk can cite itself.
title: Option<String>Document title.
heading_path: Vec<String>Enclosing headings for the first unit, outermost first.
markdown: StringRendered Markdown for the whole run.
text: StringPlain text, which is what you embed.
tokens: usizeEstimated LLM tokens for Chunk::text.
units: Vec<usize>Positions of the units this covers, for tracing back.
Trait Implementations§
impl Eq for Chunk
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Forget for Chunk
impl Freeze for Chunk
impl Move for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin 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,
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
Compare self to
key and return true if they are equal.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