pub struct Placement {
pub rank: u32,
pub structure_type: Option<String>,
pub mapped_type: Option<String>,
pub standard_type: Option<StandardType>,
pub path: Vec<StructureElement>,
pub alt: Option<String>,
pub lang: Option<String>,
pub expansion: Option<String>,
pub attributes: Vec<AttributeObject>,
}Expand description
Where one marked-content sequence sits in the tree: its rank in the
tree’s depth-first order, and the structure type of the element holding
it, as written, after the root’s /RoleMap, and as a standard type,
with the standard-typed elements above it.
Covers ISO 32000-1 §14.7.3 and §14.8.4.
Fields§
§rank: u32§structure_type: Option<String>The element’s /S, as the file writes it.
mapped_type: Option<String>structure_type followed through the role map until a name the map
has no entry for; the same name when the map never names it.
standard_type: Option<StandardType>The standard type mapped_type names, None when it names none.
path: Vec<StructureElement>The element and its ancestors that have a standard type, the root’s child first and the element itself last; an ancestor of no standard type is skipped, its children keeping their place.
alt: Option<String>The alternate description (/Alt, §14.9.3) of the element, or of
the nearest ancestor that has one, decoded as a text string.
lang: Option<String>The language (/Lang, §14.9.2) of the element, or of the nearest
ancestor that declares one; None leaves the document’s own.
expansion: Option<String>The expansion (/E, §14.9.5) of the abbreviation or acronym the
element’s text is, or the nearest ancestor’s, decoded as a text
string.
attributes: Vec<AttributeObject>Every attribute object of the element and its ancestors (§14.7.5),
the root’s child’s first; for one element, the objects its /C
classes name come before its direct /A objects, so a later object
overrides an earlier one (see Placement::attribute).
Implementations§
Source§impl Placement
impl Placement
Sourcepub fn attribute(
&self,
element: ObjRef,
owner: &str,
key: &str,
) -> Option<&Object>
pub fn attribute( &self, element: ObjRef, owner: &str, key: &str, ) -> Option<&Object>
The value key takes for element among its attribute objects of
owner: the last object that has the key wins, so a direct /A
object overrides a class’s and a later class an earlier one, the
order §14.8.5.3 gives the standard attributes. Inheritance from an
ancestor is the caller’s, since only some attributes inherit.
Covers ISO 32000-1 §14.7.5, §14.7.5.2, §14.8.5 and §14.8.5.3.