pub struct HeadingText {
pub text: String,
pub slug_text: String,
pub custom_id: Option<String>,
}Expand description
The content of a heading split into what a reader sees, what a renderer slugs, and the custom ID its attribute list declares.
Fields§
§text: StringThe text as a reader sees it: anchor elements and the attribute list removed, one of the two spaces an element sat between gone with it, and both ends trimmed.
slug_text: StringThe text a slug is generated from: the same as text, except that every
space an anchor element leaves behind stays. A browser shows
## Alpha <a id="x"></a> as “Alpha” and ## Foo <a id="x"></a> Bar as
“Foo Bar”, but GitHub and kramdown slug them to alpha- and foo--bar;
each anchor style decides for itself whether to trim and collapse.
custom_id: Option<String>The ID from a {#id} or {: #id} attribute list, if any.
Trait Implementations§
Source§impl Clone for HeadingText
impl Clone for HeadingText
Source§fn clone(&self) -> HeadingText
fn clone(&self) -> HeadingText
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 HeadingText
impl Debug for HeadingText
impl Eq for HeadingText
Source§impl PartialEq for HeadingText
impl PartialEq for HeadingText
impl StructuralPartialEq for HeadingText
Auto Trait Implementations§
impl Freeze for HeadingText
impl RefUnwindSafe for HeadingText
impl Send for HeadingText
impl Sync for HeadingText
impl Unpin for HeadingText
impl UnsafeUnpin for HeadingText
impl UnwindSafe for HeadingText
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.