pub struct Heading { /* private fields */ }
Expand description
This structure models a heading which has a level and a string title. The level is unsigned but
a value of 0
denotes a /pseudo-heading/ (see common::BlockFormat). Also the notion of a
document title is separately specified at the page level (see common::PageFormat).
A heading may also include a label string that acts as an identifier, or anchor, for the heading.
Implementations§
Source§impl Heading
impl Heading
pub fn new<S>(level: u8, title: S) -> Self
pub fn with_label<S>(self, label: S) -> Self
pub fn new_section<S>(title: S) -> Self
pub fn new_subsection<S>(title: S) -> Self
pub fn new_subsubsection<S>(title: S) -> Self
pub const fn level(&self) -> u8
pub const fn is_section(&self) -> bool
pub const fn is_subsection(&self) -> bool
pub const fn is_subsubsection(&self) -> bool
pub fn title(&self) -> &str
pub const fn label(&self) -> Option<&String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Heading
impl RefUnwindSafe for Heading
impl Send for Heading
impl Sync for Heading
impl Unpin 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