#[non_exhaustive]pub enum SectionKind {
Normal,
Preface,
Abstract,
Dedication,
Colophon,
Appendix,
Glossary,
Bibliography,
Index,
}Expand description
The structural category of a section.
AsciiDoc designates certain section styles as special sections — built-in
styles for specialized front matter and back matter (preface, glossary, …).
SectionKind captures that category, derived from the section’s style;
Normal is any ordinary (non-special) section.
This is a structural classification. Section numbering uses it to apply the special-section rules, and converters use it for presentation.
#[non_exhaustive] so further kinds (e.g. partintro, acknowledgments)
can be added without breaking downstream matches.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Normal
An ordinary section (the default).
Preface
Abstract
Dedication
Colophon
Appendix
Glossary
Bibliography
Index
Implementations§
Source§impl SectionKind
impl SectionKind
Sourcepub fn from_style(style: Option<&str>) -> Self
pub fn from_style(style: Option<&str>) -> Self
Classify a section from its block style (e.g. [preface]). Unknown or
absent styles are Normal.
Sourcepub fn as_style(self) -> Option<&'static str>
pub fn as_style(self) -> Option<&'static str>
The block style string this kind corresponds to (e.g. "preface"), or
None for Normal. Inverse of from_style.
Sourcepub fn is_special(self) -> bool
pub fn is_special(self) -> bool
Whether this is a special (front/back-matter) section. True for every
kind except Normal. Structural only — implies nothing about rendering.