Skip to main content

ContentMarks

Struct ContentMarks 

Source
pub struct ContentMarks { /* private fields */ }
Expand description

The mark stack a page object is stamped with.

Cheap to clone: Arc inside, and page objects snapshot it at creation.

Implementations§

Source§

impl ContentMarks

Source

pub fn new() -> Self

An empty stack.

Source

pub fn marks(&self) -> &[Mark]

The marks, outermost first.

Source

pub fn len(&self) -> usize

How many marks are open.

Source

pub fn is_empty(&self) -> bool

Whether nothing is marked.

Source

pub fn push(&mut self, tag: Name)

BMC: push a tag with no properties.

Source

pub fn push_with_properties( &mut self, tag: Name, properties: &MarkProperties, resolve: impl FnOnce(&Name) -> Option<Dict>, ) -> bool

BDC: push a tag with a property list.

resolve is what turns a named property list into a dictionary; when it yields nothing, no mark is pushed at all.

Source

pub fn pop(&mut self) -> bool

EMC: pop one mark, never past the sentinel.

Answers whether anything was popped — a question, not a failed mutation — so a caller can record the imbalance.

Source

pub fn content_id(&self) -> Option<i64>

The /MCID of the first mark that declares one, or None.

Source

pub fn optional_content(&self) -> Option<&Dict>

The optional-content group this content belongs to, if any.

Only a mark tagged exactly OC whose properties came from the /Properties resource counts — an inline BDC /OC << … >> is ignored entirely and its content stays visible.

Source

pub fn optional_content_all(&self) -> Vec<&Dict>

Every optional-content dictionary enclosing this content, outermost first.

A visibility test scans the whole mark stack and any one entry can veto, so nested BDC /OC sequences each get a say — which the innermost alone does not capture. The same two conditions apply to each: the tag is exactly OC, and the properties came from the /Properties resource rather than being written inline.

Trait Implementations§

Source§

impl Clone for ContentMarks

Source§

fn clone(&self) -> ContentMarks

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 ContentMarks

Source§

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

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

impl Default for ContentMarks

Source§

fn default() -> ContentMarks

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ContentMarks

Source§

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

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.