pub struct Heading {
pub level: u8,
pub id: String,
pub text: String,
pub start: usize,
}Expand description
One heading found by parsing a document, with the byte offset at which it begins.
See headings for why the offset is the useful part.
Fields§
§level: u8Heading level: 1 for #, 2 for ##, and so on.
id: StringThe id this heading claims, by the shared rule (heading_id_from) — its
explicit {#id} when the author wrote one, the slug of its text otherwise.
text: StringThe heading’s visible text, with the markup that produced it removed.
start: usizeByte offset into the source where this heading begins.
The heading’s own start, not its container’s: for > ## Quoted it
points at the #, past the blockquote marker. Callers use it to decide
which heading a later byte falls under, which is a comparison rather than
a slice, so what precedes it on the line does not concern them.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.