pub struct MDDBProject { /* private fields */ }Implementations§
Source§impl MDDBProject
impl MDDBProject
Source§impl MDDBProject
impl MDDBProject
pub fn new(root: impl AsRef<Path>) -> Result<Self>
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
Open an existing project. Returns an error if no project database exists.
Sourcepub fn get_conn(&self) -> &Connection
pub fn get_conn(&self) -> &Connection
Get a reference to the project’s database connection
pub fn get_root(&self) -> &str
Source§impl MDDBProject
impl MDDBProject
Sourcepub fn search(
&self,
query: &str,
limit: usize,
path_filter: Option<&str>,
snippet_length: Option<i64>,
) -> Result<Vec<SearchResult>>
pub fn search( &self, query: &str, limit: usize, path_filter: Option<&str>, snippet_length: Option<i64>, ) -> Result<Vec<SearchResult>>
Search the indexed documents using FTS5 full-text search.
The query string supports FTS5 syntax (e.g., “word1 word2”, “word1 OR word2”, “word1 NEAR word2”, “prefix*”). Searches body content and tags.
Results are ranked by BM25 relevance (lower score = better match).
Sourcepub fn get_links_from(&self, from_id: &str) -> Result<Vec<Link>>
pub fn get_links_from(&self, from_id: &str) -> Result<Vec<Link>>
Get all links from a document (forward traversal). Returns cross-references to other documents.
Sourcepub fn get_citations_from(&self, from_id: &str) -> Result<Vec<String>>
pub fn get_citations_from(&self, from_id: &str) -> Result<Vec<String>>
Get all citations (external URLs) from a document.
Sourcepub fn get_links_to(&self, to_id: &str) -> Result<Vec<Link>>
pub fn get_links_to(&self, to_id: &str) -> Result<Vec<Link>>
Get all links to a document (reverse traversal / backlinks).
Sourcepub fn get_reachable(
&self,
from_id: &str,
max_depth: i64,
) -> Result<Vec<ReachableNode>>
pub fn get_reachable( &self, from_id: &str, max_depth: i64, ) -> Result<Vec<ReachableNode>>
BFS traversal: get all nodes reachable from a starting node up to max_depth hops. Returns nodes with their minimum depth from the start.
Sourcepub fn read_document(&self, path: &str) -> Result<DocumentContent>
pub fn read_document(&self, path: &str) -> Result<DocumentContent>
Read a document’s content and extract its frontmatter tags. The path should be relative to the project root.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MDDBProject
impl !RefUnwindSafe for MDDBProject
impl !Sync for MDDBProject
impl !UnwindSafe for MDDBProject
impl Send for MDDBProject
impl Unpin for MDDBProject
impl UnsafeUnpin for MDDBProject
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
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> ⓘ
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> ⓘ
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