pub struct Heading {
pub level: u8,
pub children: Vec<Node>,
pub span: Span,
pub id: Option<String>,
}Fields§
§level: u8§children: Vec<Node>§span: Span§id: Option<String>Anchor id populated by the AssignHeadingIds transform (document-wide
dedupe). When None, slug() falls back to a per-heading computation.
Implementations§
Source§impl Heading
impl Heading
Sourcepub fn slug(&self) -> String
pub fn slug(&self) -> String
URL-anchor slug. Prefers the pre-computed id (only the document-scoped
pass can dedupe duplicates); else recomputes from heading text.
Sourcepub fn plain_text(nodes: &[Node]) -> String
pub fn plain_text(nodes: &[Node]) -> String
Flatten inline nodes to bare text. Recurses through emphasis and link wrappers; skips JSX and images.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Heading
impl<'de> Deserialize<'de> for Heading
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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