pub struct IndexedDocument {
pub id: String,
pub format: DocumentFormat,
pub name: String,
pub description: Option<String>,
pub source_path: Option<PathBuf>,
pub page_count: Option<usize>,
pub line_count: Option<usize>,
pub tree: Option<DocumentTree>,
pub pages: Vec<PageContent>,
}Expand description
An indexed document with its tree structure and metadata.
Fields§
§id: StringUnique document identifier.
format: DocumentFormatDocument format.
name: StringDocument name/title.
description: Option<String>Document description (generated by LLM).
source_path: Option<PathBuf>Source file path.
page_count: Option<usize>Page count (for PDFs).
line_count: Option<usize>Line count (for text files).
tree: Option<DocumentTree>The document tree structure.
pages: Vec<PageContent>Per-page content (for PDFs).
Implementations§
Source§impl IndexedDocument
impl IndexedDocument
Sourcepub fn new(id: impl Into<String>, format: DocumentFormat) -> Self
pub fn new(id: impl Into<String>, format: DocumentFormat) -> Self
Create a new indexed document.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the document description.
Sourcepub fn with_source_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_source_path(self, path: impl Into<PathBuf>) -> Self
Set the source path.
Sourcepub fn with_page_count(self, count: usize) -> Self
pub fn with_page_count(self, count: usize) -> Self
Set the page count.
Sourcepub fn with_line_count(self, count: usize) -> Self
pub fn with_line_count(self, count: usize) -> Self
Set the line count.
Sourcepub fn with_tree(self, tree: DocumentTree) -> Self
pub fn with_tree(self, tree: DocumentTree) -> Self
Set the document tree.
Trait Implementations§
Source§impl Clone for IndexedDocument
impl Clone for IndexedDocument
Source§fn clone(&self) -> IndexedDocument
fn clone(&self) -> IndexedDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IndexedDocument
impl RefUnwindSafe for IndexedDocument
impl Send for IndexedDocument
impl Sync for IndexedDocument
impl Unpin for IndexedDocument
impl UnsafeUnpin for IndexedDocument
impl UnwindSafe for IndexedDocument
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