pub struct StructElem {
pub role: StructRole,
pub raw_type: String,
pub title: Option<String>,
pub lang: Option<String>,
pub alt: Option<String>,
pub actual_text: Option<String>,
pub expansion: Option<String>,
pub page: Option<usize>,
pub kids: Vec<StructKid>,
}Expand description
One structure element (/Type /StructElem): a node of the logical tree.
Fields§
§role: StructRole/S resolved through /RoleMap and classified into a standard role.
raw_type: StringThe original /S type name, before /RoleMap resolution (equals
StructRole::as_str for a standard, unmapped type).
title: Option<String>/T — an optional human-readable title for the element.
lang: Option<String>/Lang — a BCP 47 language tag scoping this subtree (e.g. "en-US").
alt: Option<String>/Alt — an alternate textual description (accessibility), e.g. for a
StructRole::Figure.
actual_text: Option<String>/ActualText — the exact text this element stands in for (e.g. a ligature
or an image of text).
expansion: Option<String>/E — the expansion of an abbreviation or acronym carried by this element.
page: Option<usize>The element’s effective page: its own /Pg, or the nearest ancestor’s,
as a 0-based index. None when none is declared/resolvable.
kids: Vec<StructKid>The element’s children (/K).
Implementations§
Source§impl StructElem
impl StructElem
Sourcepub fn accessible_text(&self) -> Option<&str>
pub fn accessible_text(&self) -> Option<&str>
The accessibility text this element directly provides: /ActualText (the
exact replacement) if present, else /Alt (an alternate description).
Sourcepub fn child_elements(&self) -> impl Iterator<Item = &StructElem>
pub fn child_elements(&self) -> impl Iterator<Item = &StructElem>
Nested structure-element children (skipping marked-content / object kids).
Trait Implementations§
Source§impl Clone for StructElem
impl Clone for StructElem
Source§fn clone(&self) -> StructElem
fn clone(&self) -> StructElem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more