pub struct StructureTree { /* private fields */ }Expand description
The document’s structure tree root (/StructTreeRoot), loaded once per
document and asked per page where that page’s marked content sits in
the tree. /MarkInfo is never consulted: a tree with leaves counts,
whatever the file says about itself.
Implementations§
Source§impl StructureTree
impl StructureTree
Sourcepub async fn load_with<S: AsyncObjectSource>(
src: &S,
trailer: &Dict,
) -> Option<StructureTree>
pub async fn load_with<S: AsyncObjectSource>( src: &S, trailer: &Dict, ) -> Option<StructureTree>
Loads the catalog’s /StructTreeRoot, or None when the document
declares none, or when the entry is missing or unreadable, which
leaves every page in content order.
Sourcepub async fn ranks_with<S: AsyncObjectSource>(
&self,
src: &S,
page: &Page,
ids: &[MarkedContentId],
) -> FastMap<MarkedContentId, u32>
pub async fn ranks_with<S: AsyncObjectSource>( &self, src: &S, page: &Page, ids: &[MarkedContentId], ) -> FastMap<MarkedContentId, u32>
Ranks ids, one page’s marked-content sequences, by their position in
the tree’s depth-first order: 0 for the first the tree reaches, and so
on. An id the tree never reaches (untagged content, a key the parent
tree lacks, an element whose ancestry is broken) is absent, so an
empty map means the page has no leaves in the tree.
The lookup goes through the parent tree (/ParentTree, keyed by
/StructParents) and each element’s /P chain, so it costs the page’s
own elements, never a walk of the whole tree.
Trait Implementations§
Source§impl Clone for StructureTree
impl Clone for StructureTree
Source§fn clone(&self) -> StructureTree
fn clone(&self) -> StructureTree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more