pub struct KnowledgeBaseIndex {
pub pages: HashMap<PageId, PageMeta>,
pub index_issues: Vec<ParseIssue>,
/* private fields */
}Expand description
Indexed knowledge base metadata with lazy page loading.
Fields§
§pages: HashMap<PageId, PageMeta>Metadata map keyed by canonical page id.
index_issues: Vec<ParseIssue>Non-fatal issues encountered while scanning metadata.
Implementations§
Source§impl KnowledgeBaseIndex
impl KnowledgeBaseIndex
Sourcepub fn load_page(&self, id: &str) -> Result<Page>
pub fn load_page(&self, id: &str) -> Result<Page>
Loads and parses a single page by canonical id.
Returns an error if the id is missing from the index or if JSON parsing fails.
Sourcepub fn sorted_pages_by_title(&self) -> Vec<&PageMeta>
pub fn sorted_pages_by_title(&self) -> Vec<&PageMeta>
Returns metadata entries sorted case-insensitively by title.
Sourcepub fn filter_page_ids(&self, query: &str) -> Vec<PageId> ⓘ
pub fn filter_page_ids(&self, query: &str) -> Vec<PageId> ⓘ
Returns page ids filtered by metadata query (title/id/tags), sorted by title.
Sourcepub fn search_hits(&self, query: &str, include_content: bool) -> Vec<SearchHit>
pub fn search_hits(&self, query: &str, include_content: bool) -> Vec<SearchHit>
Searches pages by metadata and optionally content, returning sorted hits.
Sourcepub fn resolve_page_id_by_title(&self, title: &str) -> TitleResolution
pub fn resolve_page_id_by_title(&self, title: &str) -> TitleResolution
Resolves a page id from title using case-insensitive exact match, then partial match.
Sourcepub fn classify_link_target(&self, raw: &str) -> LinkTargetKind
pub fn classify_link_target(&self, raw: &str) -> LinkTargetKind
Classifies a raw link target for navigation/open behavior.
Trait Implementations§
Source§impl Clone for KnowledgeBaseIndex
impl Clone for KnowledgeBaseIndex
Source§fn clone(&self) -> KnowledgeBaseIndex
fn clone(&self) -> KnowledgeBaseIndex
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 KnowledgeBaseIndex
impl RefUnwindSafe for KnowledgeBaseIndex
impl Send for KnowledgeBaseIndex
impl Sync for KnowledgeBaseIndex
impl Unpin for KnowledgeBaseIndex
impl UnsafeUnpin for KnowledgeBaseIndex
impl UnwindSafe for KnowledgeBaseIndex
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