Skip to main content

StructRole

Enum StructRole 

Source
pub enum StructRole {
Show 15 variants Document, Heading(u8), Paragraph, Figure, Table, TableRow, TableHeaderCell, TableCell, List, ListItem, ListItemLabel, ListItemBody, Toc, TocItem, Artifact,
}
Expand description

The PDF standard structure types (ISO 32000-1 14.8.4, Table 333/334) this crate tags content with — no RoleMap needed since all of these are standard types. Grouping roles (see StructRole::is_grouping) nest child StructElems and own no marked content of their own; Artifact is excluded from the structure tree entirely (watermarks, running headers/footers — PDF/UA pagination artifacts, not content).

Variants§

§

Document

§

Heading(u8)

Text::outline_level 1-6, clamped (.outline_level(7+) still produces valid output, just tagged as the deepest standard heading level rather than inventing a 7th).

§

Paragraph

§

Figure

§

Table

§

TableRow

§

TableHeaderCell

§

TableCell

§

List

§

ListItem

§

ListItemLabel

§

ListItemBody

§

Toc

§

TocItem

§

Artifact

Not structure content at all — BDC/EMC with no MCID, entirely excluded from /StructTreeRoot (ISO 32000-1 14.8.2.2).

Implementations§

Source§

impl StructRole

Source

pub fn is_grouping(self) -> bool

true for roles that only nest child StructElems (no marked content of their own — see RenderNode::Tagged’s doc comment).

Source

pub fn tag_name(self) -> &'static str

The PDF structure type name (ISO 32000-1 Table 333/334).

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 Copy for StructRole

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<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, 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> 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 = !

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.