pub struct BodyLink {
pub link: Link,
pub span: Range<usize>,
}Expand description
One link found in body prose: the parsed Link (target, label, and whether
it was an Obsidian [[…]] wikilink or a markdown/djot [label](target)
link) together with the byte span of the whole construct
— exactly what a rewrite replaces. The unifying body-link currency: census,
check, and the rename machinery all consume this, blind to which syntax the
link was written in.
Fields§
§link: LinkThe parsed link — render reproduces its original
wrapper, so a retargeted [[a]] stays a wikilink and a [t](a) stays a
markdown link.
span: Range<usize>Byte range of the whole link construct within the scanned body.
Implementations§
Source§impl BodyLink
impl BodyLink
Sourcepub fn id_target(&self) -> Option<Id>
pub fn id_target(&self) -> Option<Id>
The stable ID this link names, if any — Link::id_target on the inner
link. ID targets are never rewritten by a move.
Sourcepub fn is_path_target(&self) -> bool
pub fn is_path_target(&self) -> bool
Whether this link’s target is a path — Link::is_path_target on the
inner link. The predicate the body-rewrite passes filter on.
Trait Implementations§
impl Eq for BodyLink
impl StructuralPartialEq for BodyLink
Auto Trait Implementations§
impl Freeze for BodyLink
impl RefUnwindSafe for BodyLink
impl Send for BodyLink
impl Sync for BodyLink
impl Unpin for BodyLink
impl UnsafeUnpin for BodyLink
impl UnwindSafe for BodyLink
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.