pub(super) struct Targets<'a> {
headings: Vec<Heading>,
markers: BTreeMap<&'a str, Range<usize>>,
}Expand description
Top level headings and marker regions of a document, as byte ranges.
Fields§
§headings: Vec<Heading>§markers: BTreeMap<&'a str, Range<usize>>Implementations§
Source§impl<'a> Targets<'a>
impl<'a> Targets<'a>
Sourcepub(super) fn scan(source: Text<'a>) -> Result<Self, DocumentError>
pub(super) fn scan(source: Text<'a>) -> Result<Self, DocumentError>
Scan the direct children of the document for headings and marker comments. Anything nested in a container or code block is ignored.
Sourcepub(super) fn heading(
&self,
level: HeadingLevel,
) -> Result<Range<usize>, MarkdownError>
pub(super) fn heading( &self, level: HeadingLevel, ) -> Result<Range<usize>, MarkdownError>
The range of the single heading with this level.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Targets<'a>
impl<'a> RefUnwindSafe for Targets<'a>
impl<'a> Send for Targets<'a>
impl<'a> Sync for Targets<'a>
impl<'a> Unpin for Targets<'a>
impl<'a> UnsafeUnpin for Targets<'a>
impl<'a> UnwindSafe for Targets<'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