pub struct Wiki { /* private fields */ }Expand description
Unified wiki structure with lazy-loaded content caching.
Implementations§
Source§impl Wiki
impl Wiki
Sourcepub fn build(root: WikiRoot, config: WikiConfig) -> Result<Self, WikiError>
pub fn build(root: WikiRoot, config: WikiConfig) -> Result<Self, WikiError>
Build wiki from root — discovers paths only, no file reads.
pub fn root(&self) -> &WikiRoot
pub fn config(&self) -> &WikiConfig
pub fn pages(&self) -> &HashMap<PageId, PageEntry>
pub fn get(&self, id: &PageId) -> Option<&PageEntry>
pub fn contains(&self, id: &PageId) -> bool
Sourcepub fn find(&self, name: &str) -> Option<(&PageId, &PageEntry)>
pub fn find(&self, name: &str) -> Option<(&PageId, &PageEntry)>
Find a page by name. Always O(1) since PageIds are normalized to lowercase.
Sourcepub fn display_name(&self, id: &PageId) -> Option<&str>
pub fn display_name(&self, id: &PageId) -> Option<&str>
Get the display name for a page (original filename case from rel_path).
pub fn index_path(&self) -> Option<PathBuf>
Sourcepub fn entry_path(&self, entry: &PageEntry) -> PathBuf
pub fn entry_path(&self, entry: &PageEntry) -> PathBuf
Get the absolute path for a page entry.
Sourcepub fn rel_path<'a>(&self, path: &'a Path) -> &'a Path
pub fn rel_path<'a>(&self, path: &'a Path) -> &'a Path
Convert an absolute path to a path relative to the wiki root.
Sourcepub fn all_scannable_files(&self) -> Vec<PathBuf>
pub fn all_scannable_files(&self) -> Vec<PathBuf>
All wiki page files that should be scanned for wikilink content.
Sourcepub fn autolink_pages(&self) -> Result<&HashSet<PageId>, WikiError>
pub fn autolink_pages(&self) -> Result<&HashSet<PageId>, WikiError>
Autolink pages — lazily computed on first access.
pub fn abs_path(&self, path: &Path) -> PathBuf
Sourcepub fn file(&self, path: &Path) -> Result<&CachedFile, WikiError>
pub fn file(&self, path: &Path) -> Result<&CachedFile, WikiError>
Get cached file, loading on first access.
Sourcepub fn frontmatter(
&self,
path: &Path,
) -> Result<&Result<Option<Frontmatter>, FrontmatterError>, WikiError>
pub fn frontmatter( &self, path: &Path, ) -> Result<&Result<Option<Frontmatter>, FrontmatterError>, WikiError>
Get frontmatter for a file.
Sourcepub fn wikilinks(&self, path: &Path) -> Result<&[WikilinkOccurrence], WikiError>
pub fn wikilinks(&self, path: &Path) -> Result<&[WikilinkOccurrence], WikiError>
Get wikilinks for a file.
Sourcepub fn classified_ranges(
&self,
path: &Path,
) -> Result<&[ClassifiedRange], WikiError>
pub fn classified_ranges( &self, path: &Path, ) -> Result<&[ClassifiedRange], WikiError>
Get classified ranges for a file.
Sourcepub fn block_ids(&self, path: &Path) -> Result<&[BlockId], WikiError>
pub fn block_ids(&self, path: &Path) -> Result<&[BlockId], WikiError>
Get block IDs for a file.
Auto Trait Implementations§
impl !Freeze for Wiki
impl !RefUnwindSafe for Wiki
impl Send for Wiki
impl !Sync for Wiki
impl Unpin for Wiki
impl UnsafeUnpin for Wiki
impl !UnwindSafe for Wiki
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