pub struct RawRef {
pub text: String,
pub syntax: RefSyntax,
pub byte_from: usize,
pub byte_to: usize,
pub ref_from: usize,
pub ref_to: usize,
}Expand description
A raw reference extracted from a markdown source string.
Fields§
§text: StringThe resolved/target text (the inner stem, a/b, or path part — no
brackets, no alias, no pothole). This is the string to pass to the
classifier.
syntax: RefSyntaxWhich syntax form produced this reference.
byte_from: usizeByte offset in the source string where the token starts (inclusive).
byte_to: usizeByte offset in the source string where the token ends (exclusive).
ref_from: usizeByte span of text itself inside the source — the
wikilink target, or the markdown destination with any title stripped.
source[ref_from..ref_to] == text.
A RENAME replaces exactly this span, which is narrower than
byte_from..byte_to and never covers a nested reference. That is what
makes [![[hero.png]]](/album/) rewritable: the inner embed’s span and
the outer link’s destination span are disjoint, so both can be edited
in one pass. Rebuilding the whole token from syntax instead would
re-emit the label verbatim and silently drop the inner rewrite.
ref_to: usizeExclusive end of ref_from.
Trait Implementations§
impl Eq for RawRef
impl StructuralPartialEq for RawRef
Auto Trait Implementations§
impl Freeze for RawRef
impl RefUnwindSafe for RawRef
impl Send for RawRef
impl Sync for RawRef
impl Unpin for RawRef
impl UnsafeUnpin for RawRef
impl UnwindSafe for RawRef
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.