pub enum StructRole {
Show 50 variants
Document,
Part,
Art,
Sect,
Div,
BlockQuote,
Caption,
Toc,
Toci,
Index,
NonStruct,
Private,
P,
H,
H1,
H2,
H3,
H4,
H5,
H6,
L,
Li,
Lbl,
LBody,
Table,
Tr,
Th,
Td,
THead,
TBody,
TFoot,
Span,
Quote,
Note,
Reference,
BibEntry,
Code,
Link,
Annot,
Ruby,
Rb,
Rt,
Rp,
Warichu,
Wt,
Wp,
Figure,
Formula,
Form,
Other(String),
}Expand description
A standard structure type (ISO 32000-1 §14.8.4), the role of a structure
element after resolving its /S through the document’s /RoleMap. A type
outside the standard set (and not mapped onto it) is StructRole::Other.
Variants§
Document
Part
Art
Sect
Div
BlockQuote
Caption
Toc
Table of contents (TOC).
Toci
Table-of-contents item (TOCI).
Index
NonStruct
Private
P
H
H1
H2
H3
H4
H5
H6
L
Li
List item (LI).
Lbl
List-item label (Lbl).
LBody
List-item body (LBody).
Table
Tr
Table row (TR).
Th
Table header cell (TH).
Td
Table data cell (TD).
THead
Table header row group (THead).
TBody
Table body row group (TBody).
TFoot
Table footer row group (TFoot).
Span
Quote
Note
Reference
BibEntry
Code
Link
Annot
Ruby
Rb
Ruby base text (RB).
Rt
Ruby annotation text (RT).
Rp
Ruby punctuation (RP).
Warichu
Wt
Warichu text (WT).
Wp
Warichu punctuation (WP).
Figure
Formula
Form
Other(String)
A non-standard type: the resolved type name (possibly the producer’s own,
when /RoleMap did not map it onto a standard type).
Implementations§
Source§impl StructRole
impl StructRole
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
The canonical PDF type name for this role (Toc → "TOC", Li → "LI",
…). For StructRole::Other this is the resolved producer type name.
Sourcepub fn is_standard(&self) -> bool
pub fn is_standard(&self) -> bool
True when this is a recognized standard structure type (not
StructRole::Other).
Sourcepub fn is_heading(&self) -> bool
pub fn is_heading(&self) -> bool
True for a heading role (H or H1…H6).
Sourcepub fn is_block_level(&self) -> bool
pub fn is_block_level(&self) -> bool
True for a block-level role — a grouping element or a block-level
structure element (paragraph, heading, list item, table row, figure …)
that begins on its own line when serializing the tree to reading-ordered
text. Inline-level roles (Span, Quote, Link, Reference,
ruby/warichu …), the transparent NonStruct/Private grouping, and the
intra-line structure roles flow inline: a list item’s label and body
(Lbl/LBody) read on one line with the item, and a row’s cells
(TH/TD, and the THead/TBody/TFoot row groups) read across the
row rather than each on its own line.
Trait Implementations§
Source§impl Clone for StructRole
impl Clone for StructRole
Source§fn clone(&self) -> StructRole
fn clone(&self) -> StructRole
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more