StructRole2

Enum StructRole2 

Source
pub enum StructRole2 {
Show 41 variants Document, DocumentFragment, Part, Sect, Div, Aside, NonStruct, P, Heading(NonZeroU16), StructuredHeading, Title, FENote, Sub, Lbl, Span, Em, Strong, Link, Annot, Form, Ruby, RB, RT, RP, Warichu, WT, WP, L, LI, LBody, Table, TR, TH, TD, THead, TBody, TFoot, Caption, Figure, Formula, Artifact,
}
Expand description

PDF 2.0 roles the structure element fulfills in the document.

These are the predefined standard roles in PDF 2.0, matching the https://www.iso.org/pdf2/ssn namespace. The writer may write their own types and then provide a mapping using Namespace::role_map_ns. PDF 2.0+.

Variants§

§

Document

The whole document.

§

DocumentFragment

An incomplete fragment of another document.

§

Part

A part of a document that may contain multiple articles or sections.

§

Sect

Section of a larger document.

§

Div

Generic subdivision.

§

Aside

Content distinct from other content within the parent, such as callouts, sidebars, commentary, or background information.

§

NonStruct

Element only present for grouping purposes that shall not be exported.

§

P

A paragraph

§

Heading(NonZeroU16)

Heading with a specific level.

§

StructuredHeading

Strongly structured heading.

§

Title

A title of a document.

§

FENote

A foot- or endnote.

§

Sub

A subdivision within a block level element.

§

Lbl

Label for a list item.

§

Span

A generic inline element.

§

Em

An emphasized inline element.

§

Strong

An inline element with heightened (strong) importance.

A link.

§

Annot

An association between an annotation and the content it belongs to.

§

Form

Form widget.

§

Ruby

Ruby annotation for CJK text.

§

RB

Base text of a Ruby annotation.

§

RT

Annotation text of a Ruby annotation.

§

RP

Punctuation in a Ruby annotation.

§

Warichu

Warichu annotation for CJK text.

§

WT

Text of a Warichu annotation.

§

WP

Punctuation of a Warichu annotation.

§

L

A list.

§

LI

A list item.

§

LBody

Description of the list item.

§

Table

A table.

§

TR

A table row.

§

TH

A table header cell.

§

TD

A table data cell.

§

THead

A table header row group.

§

TBody

A table data row group.

§

TFoot

A table footer row group.

§

Caption

An image or figure caption.

§

Figure

Item of graphical content.

§

Formula

Mathematical formula.

§

Artifact

An artifact not part of the logical content of the document.

Implementations§

Source§

impl StructRole2

Source

pub fn to_name(self, buf: &mut [u8; 6]) -> Name<'_>

Convert the role into its Name serialization.

The buf parameter is a mutable buffer of 6 bytes that will be used to store the name in the event that the role is a heading with a level.

Source

pub fn compatibility_1_7(self, opts: RoleMapOpts) -> StructRole2Compat

How the type should be represented in PDF 1.7.

The opts parameter allows to control how certain roles are represented in PDF 1.7. You can also use its default constructor.

Source

pub fn role_type(self) -> StructRoleType2

Return the type of the structure element.

Trait Implementations§

Source§

impl Clone for StructRole2

Source§

fn clone(&self) -> StructRole2

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for StructRole2

Source§

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

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

impl Hash for StructRole2

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StructRole2

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<StructRole> for StructRole2

Source§

type Error = ()

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

fn try_from(value: StructRole) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<StructRole2> for StructRole

Source§

type Error = ()

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

fn try_from(value: StructRole2) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for StructRole2

Source§

impl Eq for StructRole2

Source§

impl StructuralPartialEq for StructRole2

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> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
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 = 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.