Skip to main content

Placement

Struct Placement 

Source
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

Source

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.

Trait Implementations§

Source§

impl Clone for Placement

Source§

fn clone(&self) -> Self

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 Placement

Source§

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

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

impl PartialEq for Placement

Source§

fn eq(&self, other: &Self) -> 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 Placement

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

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.