pub struct MarkdownDocument {
pub path: PathBuf,
pub title: Option<String>,
pub metadata: HashMap<String, String>,
pub chunks: Vec<MarkdownChunk>,
}Expand description
A parsed markdown document with extracted metadata and content chunks.
This structure represents a fully processed markdown file, including:
- The original file path for reference
- An optional title extracted from the first h1 heading or front-matter
- Metadata from YAML front-matter
- Content broken into semantic chunks for embedding
Fields§
§path: PathBufPath to the source markdown file.
title: Option<String>Document title, extracted from front-matter or first h1 heading.
metadata: HashMap<String, String>Metadata extracted from YAML front-matter. Common keys include: author, date, tags, description, etc.
chunks: Vec<MarkdownChunk>Content chunks, each representing a semantic unit of the document.
Implementations§
Source§impl MarkdownDocument
impl MarkdownDocument
Sourcepub fn full_text(&self) -> String
pub fn full_text(&self) -> String
Get all text content concatenated (useful for full-document embedding).
Sourcepub fn text_chunks(&self) -> impl Iterator<Item = &MarkdownChunk>
pub fn text_chunks(&self) -> impl Iterator<Item = &MarkdownChunk>
Get only text chunks (excluding code blocks).
Sourcepub fn code_chunks(&self) -> impl Iterator<Item = &MarkdownChunk>
pub fn code_chunks(&self) -> impl Iterator<Item = &MarkdownChunk>
Get only code block chunks.
Trait Implementations§
Source§impl Clone for MarkdownDocument
impl Clone for MarkdownDocument
Source§fn clone(&self) -> MarkdownDocument
fn clone(&self) -> MarkdownDocument
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 moreSource§impl Debug for MarkdownDocument
impl Debug for MarkdownDocument
Source§impl<'de> Deserialize<'de> for MarkdownDocument
impl<'de> Deserialize<'de> for MarkdownDocument
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MarkdownDocument
impl RefUnwindSafe for MarkdownDocument
impl Send for MarkdownDocument
impl Sync for MarkdownDocument
impl Unpin for MarkdownDocument
impl UnsafeUnpin for MarkdownDocument
impl UnwindSafe for MarkdownDocument
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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request