pub struct TitleIndex { /* private fields */ }Expand description
A name → document(s) index built by scanning a workspace. Names are the
documents’ title fields and their file stems; a document is registered
under both so [[My File]] (by title) and [[my-file]] (by stem) both find
it.
Implementations§
Source§impl TitleIndex
impl TitleIndex
Sourcepub fn insert(&mut self, name: impl Into<String>, path: impl Into<PathBuf>)
pub fn insert(&mut self, name: impl Into<String>, path: impl Into<PathBuf>)
Index path under name (a title or a file stem). A blank name is
ignored; a duplicate (name, path) pair collapses, so registering a
document under both a title and an identical stem does not make it look
ambiguous.
Sourcepub fn resolve(&self, name: &str) -> TitleMatch
pub fn resolve(&self, name: &str) -> TitleMatch
Resolve name to a document. Unique when exactly one claims it,
Ambiguous when several do, Unknown when none.
Trait Implementations§
Source§impl Clone for TitleIndex
impl Clone for TitleIndex
Source§fn clone(&self) -> TitleIndex
fn clone(&self) -> TitleIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TitleIndex
impl Debug for TitleIndex
Source§impl Default for TitleIndex
impl Default for TitleIndex
Source§fn default() -> TitleIndex
fn default() -> TitleIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TitleIndex
impl RefUnwindSafe for TitleIndex
impl Send for TitleIndex
impl Sync for TitleIndex
impl Unpin for TitleIndex
impl UnsafeUnpin for TitleIndex
impl UnwindSafe for TitleIndex
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