pub struct HeadingAttrs {
pub id: Option<String>,
pub classes: Vec<String>,
pub attrs: Vec<(String, Option<String>)>,
pub source_trailer: String,
}Expand description
Heading attribute trailer recognised on an ATX heading.
Fields§
§id: Option<String>{#id ...}. Only the first id in source order is kept (pulldown
drops subsequent ids).
classes: Vec<String>.class tokens in source order.
attrs: Vec<(String, Option<String>)>key=value pairs in source order. The value is None for a
bare key token with no =.
source_trailer: StringSource bytes of the {...} trailer (including braces). Empty
only when the trailer scanner failed to relocate the braces in
the heading source; the canonicalise pass then falls back to a
structured render.
Implementations§
Source§impl HeadingAttrs
impl HeadingAttrs
Sourcepub fn canonical_trailer(&self) -> String
pub fn canonical_trailer(&self) -> String
Render the trailer in canonical order: #id, then classes in
source order, then key=value pairs in source order. Values
containing whitespace are double-quoted; values containing a
double quote are double-quoted with embedded \".
Trait Implementations§
Source§impl Clone for HeadingAttrs
impl Clone for HeadingAttrs
Source§fn clone(&self) -> HeadingAttrs
fn clone(&self) -> HeadingAttrs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HeadingAttrs
impl Debug for HeadingAttrs
Source§impl PartialEq for HeadingAttrs
impl PartialEq for HeadingAttrs
Source§fn eq(&self, other: &HeadingAttrs) -> bool
fn eq(&self, other: &HeadingAttrs) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for HeadingAttrs
impl StructuralPartialEq for HeadingAttrs
Auto Trait Implementations§
impl Freeze for HeadingAttrs
impl RefUnwindSafe for HeadingAttrs
impl Send for HeadingAttrs
impl Sync for HeadingAttrs
impl Unpin for HeadingAttrs
impl UnsafeUnpin for HeadingAttrs
impl UnwindSafe for HeadingAttrs
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