pub struct Reference {
pub source_path: PathBuf,
pub line_number: u32,
pub column: u32,
pub start: usize,
pub end: usize,
pub original: String,
pub ref_type: ReferenceType,
pub alias: Option<String>,
pub section: Option<String>,
pub target_as_written: String,
}Expand description
A reference to a note found in a file
Fields§
§source_path: PathBufFile containing the reference
line_number: u32Line number (1-based, 0 for frontmatter)
column: u32Column number (1-based)
start: usizeByte offset start in file
end: usizeByte offset end in file
original: StringOriginal text of the reference (e.g., “[[old-note|Alias]]”)
ref_type: ReferenceTypeReference type
alias: Option<String>For wikilinks with aliases, the alias text
section: Option<String>For wikilinks with sections, the section anchor
target_as_written: StringThe link target as written (may be basename or full path)
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn is_wikilink(&self) -> bool
pub fn is_wikilink(&self) -> bool
Returns true if this is a wikilink-style reference
Sourcepub fn is_markdown_link(&self) -> bool
pub fn is_markdown_link(&self) -> bool
Returns true if this is a markdown link reference
Sourcepub fn is_frontmatter(&self) -> bool
pub fn is_frontmatter(&self) -> bool
Returns true if this is a frontmatter reference
Sourcepub fn uses_full_path(&self) -> bool
pub fn uses_full_path(&self) -> bool
Returns true if the original reference used a full path (not just basename)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnsafeUnpin for Reference
impl UnwindSafe for Reference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more