pub struct Heading {
pub text: String,
pub level: u32,
pub span: Range<usize>,
}Expand description
The heading a place in the document sits under — the answer to
Doc::heading_at.
What a host writing a link to a position needs: the #its-slug half of a
reference is made from text, and a peek at the target draws span.
Fields§
§text: StringThe heading’s inline content with its markup stripped — A *big* day
is A big day — which is what a slug is made from.
level: u321 for #, 2 for ##, and so on.
span: Range<usize>The heading block’s own source span, marker and all — the heading, not the section it opens.
Trait Implementations§
impl Eq for Heading
impl StructuralPartialEq for Heading
Auto Trait Implementations§
impl Freeze for Heading
impl RefUnwindSafe for Heading
impl Send for Heading
impl Sync for Heading
impl Unpin for Heading
impl UnsafeUnpin for Heading
impl UnwindSafe for Heading
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