pub struct Bundle { /* private fields */ }Expand description
A loaded OKF bundle.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn load(root: impl AsRef<Path>) -> Result<Bundle, BundleError>
pub fn load(root: impl AsRef<Path>) -> Result<Bundle, BundleError>
Loads a bundle from a directory tree.
Returns an error only for I/O failures or a non-directory root. Per-file
parse failures are recorded in Bundle::parse_errors.
Sourcepub fn index_files(&self) -> &[PathBuf]
pub fn index_files(&self) -> &[PathBuf]
Paths of all index.md files found (§6).
Sourcepub fn parse_errors(&self) -> &[(PathBuf, DocumentError)]
pub fn parse_errors(&self) -> &[(PathBuf, DocumentError)]
Files whose frontmatter could not be parsed during loading.
Sourcepub fn links_from(&self, id: &ConceptId) -> &[ResolvedLink]
pub fn links_from(&self, id: &ConceptId) -> &[ResolvedLink]
The resolved outbound cross-links from a concept.
Sourcepub fn backlinks(&self, id: &ConceptId) -> &[ConceptId]
pub fn backlinks(&self, id: &ConceptId) -> &[ConceptId]
The ids of concepts that link to the given concept (“cited by” / § backlinks).
Sourcepub fn broken_links(&self) -> Vec<(ConceptId, String)>
pub fn broken_links(&self) -> Vec<(ConceptId, String)>
All broken internal links in the bundle, as (source, raw_target)
pairs. Broken links are permitted by the spec (§5.3) — this is
informational.
Sourcepub fn okf_version(&self) -> Option<String>
pub fn okf_version(&self) -> Option<String>
The declared OKF version from the bundle-root index.md frontmatter, if
present (okf_version, §11). This is the only place frontmatter is
permitted in an index.md.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
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