pub struct BaseLink {
pub path: String,
pub display: Option<String>,
}Expand description
A wikilink value: a target path plus an optional display label. Produced by
the link(...) function, by frontmatter [[wikilinks]], and by file.asLink.
Fields§
§path: StringThe link target as written (e.g. Categories/Books or Books). The
.md extension and any [[ ]]/alias are already stripped.
display: Option<String>Optional display text (link("path", "Display") or [[path|Display]]).
Implementations§
Source§impl BaseLink
impl BaseLink
pub fn new(path: impl Into<String>) -> Self
pub fn with_display(path: impl Into<String>, display: impl Into<String>) -> Self
Sourcepub fn basename(&self) -> &str
pub fn basename(&self) -> &str
The path’s final segment without directories or extension — how Obsidian
compares links written as full paths vs bare names
(link("Categories/Books") matches a note named Books).
Sourcepub fn same_target(&self, other: &BaseLink) -> bool
pub fn same_target(&self, other: &BaseLink) -> bool
Two links refer to the same note if their basenames match (Obsidian resolves short links by basename) OR one path is a suffix-path of the other.
Trait Implementations§
impl StructuralPartialEq for BaseLink
Auto Trait Implementations§
impl Freeze for BaseLink
impl RefUnwindSafe for BaseLink
impl Send for BaseLink
impl Sync for BaseLink
impl Unpin for BaseLink
impl UnsafeUnpin for BaseLink
impl UnwindSafe for BaseLink
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