Skip to main content

MarkdownSource

Trait MarkdownSource 

Source
pub trait MarkdownSource: Send + Sync {
    // Required methods
    fn index_all(&self) -> Result<usize>;
    fn note_tree(&self, dir: &str) -> Result<Vec<NoteEntry>>;
    fn note_read(&self, path: &str) -> Result<Option<String>>;
    fn extract_headings(&self, content: &str) -> Vec<String>;
}
Expand description

Abstract markdown knowledge source.

Implemented by oxios_markdown::KnowledgeBase in the kernel. Allows auto_bridge to read .md files without depending on oxios-markdown directly.

Required Methods§

Source

fn index_all(&self) -> Result<usize>

Re-index all markdown files. Returns file count.

Source

fn note_tree(&self, dir: &str) -> Result<Vec<NoteEntry>>

List files/directories under dir.

Source

fn note_read(&self, path: &str) -> Result<Option<String>>

Read a note’s content. Returns None if not found.

Source

fn extract_headings(&self, content: &str) -> Vec<String>

Extract markdown headings from content.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§