#[non_exhaustive]pub struct Anchor<'a> {
pub id: &'a str,
pub xreflabel: Option<&'a str>,
pub location: Location,
/* private fields */
}Expand description
An Anchor represents an anchor in a document.
An anchor is a reference point in a document that can be linked to.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: &'a str§xreflabel: Option<&'a str>§location: LocationImplementations§
Source§impl<'a> Anchor<'a>
impl<'a> Anchor<'a>
Sourcepub fn new(id: &'a str, location: Location) -> Self
pub fn new(id: &'a str, location: Location) -> Self
Create a new anchor with the given ID and location.
Sourcepub fn with_xreflabel(self, xreflabel: Option<&'a str>) -> Self
pub fn with_xreflabel(self, xreflabel: Option<&'a str>) -> Self
Set the cross-reference label.
Sourcepub fn is_bibliography(&self) -> bool
pub fn is_bibliography(&self) -> bool
Returns whether this anchor identifies a bibliography entry.
Sourcepub fn bibliography_label(&self) -> Option<&[InlineNode<'a>]>
pub fn bibliography_label(&self) -> Option<&[InlineNode<'a>]>
Return the entry label after its source-position inline substitutions.
Citation text remains separate in Self::xreflabel. Returns None
for ordinary anchors and entries that use their ID as the label.
Trait Implementations§
impl<'a> StructuralPartialEq for Anchor<'a>
Auto Trait Implementations§
impl<'a> Freeze for Anchor<'a>
impl<'a> RefUnwindSafe for Anchor<'a>
impl<'a> Send for Anchor<'a>
impl<'a> Sync for Anchor<'a>
impl<'a> Unpin for Anchor<'a>
impl<'a> UnsafeUnpin for Anchor<'a>
impl<'a> UnwindSafe for Anchor<'a>
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