Skip to main content

Targets

Struct Targets 

Source
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>

Source

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.

Source

pub(super) fn heading( &self, level: HeadingLevel, ) -> Result<Range<usize>, MarkdownError>

The range of the single heading with this level.

Source

pub(super) fn marker(&self, name: &str) -> Result<Range<usize>, MarkdownError>

The range between the begin and end marker lines of this name.

Trait Implementations§

Source§

impl<'a> Debug for Targets<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.