pub struct SectionNode {
pub name: String,
pub depth: u8,
pub pos: SourcePos,
pub sections: Vec<SectionNode>,
pub blocks: Vec<BlockNode>,
pub anchors: Vec<String>,
pub range: Range<usize>,
}Expand description
A heading-delimited section: exact heading text, TRUE heading depth (a skipped level is preserved, not synthesized), heading position, nested subsections, heading-direct blocks (no hoisting), and section-level anchors.
Fields§
§name: Stringheading text, trimmed (exact, case-sensitive)
depth: u81..6 (the synthetic root is depth 1)
pos: SourcePosthe heading’s position
sections: Vec<SectionNode>nested subsections
blocks: Vec<BlockNode>blocks directly under the heading
anchors: Vec<String>section-level ^block-ids (block-bound ids live on the block)
range: Range<usize>the section’s bytes in DocTree::body: from the start of its heading
line to the start of the next heading of the same or a shallower depth,
or the end of the body. Subsections are inside it. The root’s range is
the whole body.
Implementations§
Source§impl SectionNode
impl SectionNode
Sourcepub fn block_by_id(&self, id: &str) -> Option<&BlockNode>
pub fn block_by_id(&self, id: &str) -> Option<&BlockNode>
The first block bound to ^id, here or in any subsection, depth first.
Trait Implementations§
Source§impl Clone for SectionNode
impl Clone for SectionNode
Source§impl Debug for SectionNode
impl Debug for SectionNode
impl Eq for SectionNode
Source§impl PartialEq for SectionNode
impl PartialEq for SectionNode
impl StructuralPartialEq for SectionNode
Auto Trait Implementations§
impl Freeze for SectionNode
impl RefUnwindSafe for SectionNode
impl Send for SectionNode
impl Sync for SectionNode
impl Unpin for SectionNode
impl UnsafeUnpin for SectionNode
impl UnwindSafe for SectionNode
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§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.