Skip to main content

StructRole

Enum StructRole 

Source
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

§

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

Source

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.

Source

pub fn is_standard(&self) -> bool

True when this is a recognized standard structure type (not StructRole::Other).

Source

pub fn is_heading(&self) -> bool

True for a heading role (H or H1H6).

Source

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

Source§

fn clone(&self) -> StructRole

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StructRole

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StructRole

Source§

impl PartialEq for StructRole

Source§

fn eq(&self, other: &StructRole) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StructRole

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more