pub struct Link<'source> { /* private fields */ }Expand description
Link node for wiki-style links.
Implementations§
Source§impl<'source> Link<'source>
impl<'source> Link<'source>
Sourcepub fn new(source: &'source str, open: Range<usize>, line: Range<usize>) -> Self
pub fn new(source: &'source str, open: Range<usize>, line: Range<usize>) -> Self
Create a new link.
Sourcepub fn label(&self) -> &str
pub fn label(&self) -> &str
Get the link label.
If an owned value has been set it is preferred.
Sourcepub fn title(&self) -> &str
pub fn title(&self) -> &str
Get the link title.
If an owned value has been set it is preferred.
Sourcepub fn label_span(&self) -> &Range<usize>
pub fn label_span(&self) -> &Range<usize>
Get the span for the label.
Sourcepub fn title_span(&self) -> &Range<usize>
pub fn title_span(&self) -> &Range<usize>
Get the span for the title.
Sourcepub fn label_start(&mut self, start: usize)
pub fn label_start(&mut self, start: usize)
Update the start of the label span.
Sourcepub fn title_start(&mut self, start: usize)
pub fn title_start(&mut self, start: usize)
Update the start of the title span.
Sourcepub fn set_href(&mut self, value: String)
pub fn set_href(&mut self, value: String)
Set an owned value for the href.
Only available when the parser detects escape sequences in the input.
Sourcepub fn set_label(&mut self, value: String)
pub fn set_label(&mut self, value: String)
Set an owned value for the label.
Only available when the parser detects escape sequences in the input.
Sourcepub fn set_title(&mut self, value: String)
pub fn set_title(&mut self, value: String)
Set an owned value for the title.
Only available when the parser detects escape sequences in the input.
Sourcepub fn is_escaped(&self) -> bool
pub fn is_escaped(&self) -> bool
Determine if this link has been escaped using a leading backslash.
Trait Implementations§
impl<'source> Eq for Link<'source>
impl<'source> StructuralPartialEq for Link<'source>
Auto Trait Implementations§
impl<'source> Freeze for Link<'source>
impl<'source> RefUnwindSafe for Link<'source>
impl<'source> Send for Link<'source>
impl<'source> Sync for Link<'source>
impl<'source> Unpin for Link<'source>
impl<'source> UnwindSafe for Link<'source>
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