pub struct PdfStructTree<'a> { /* private fields */ }Expand description
The structure tree of a PDF page, providing semantic document structure for tagged PDFs.
Elements in the tree have types like P (paragraph), H1-H6 (headings),
Table, Figure, etc. The tree must be closed when it is no longer needed;
this is handled automatically via the Drop implementation.
The tree handle is owned by this struct and will be released when it goes out of scope.
Implementations§
Source§impl<'a> PdfStructTree<'a>
impl<'a> PdfStructTree<'a>
Sourcepub fn children_count(&self) -> usize
pub fn children_count(&self) -> usize
Returns the number of top-level children in this structure tree.
Sourcepub fn child_at_index(&self, index: usize) -> Option<PdfStructElement<'_>>
pub fn child_at_index(&self, index: usize) -> Option<PdfStructElement<'_>>
Returns the top-level child element at the given index, or None on error
or out-of-bounds index.
Sourcepub fn children(&self) -> PdfStructTreeChildrenIterator<'_> ⓘ
pub fn children(&self) -> PdfStructTreeChildrenIterator<'_> ⓘ
Returns an iterator over the top-level children of this structure tree.
Sourcepub fn iter(&self) -> PdfStructTreeIterator<'_> ⓘ
pub fn iter(&self) -> PdfStructTreeIterator<'_> ⓘ
Returns a depth-first iterator over all elements in the structure tree.
Each item is a tuple of (element, depth) where depth starts at 0 for
top-level (root) elements and increases by 1 for each level of nesting.
Trait Implementations§
Source§impl Drop for PdfStructTree<'_>
impl Drop for PdfStructTree<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PdfStructTree<'a>
impl<'a> !Send for PdfStructTree<'a>
impl<'a> !Sync for PdfStructTree<'a>
impl<'a> !UnwindSafe for PdfStructTree<'a>
impl<'a> Freeze for PdfStructTree<'a>
impl<'a> Unpin for PdfStructTree<'a>
impl<'a> UnsafeUnpin for PdfStructTree<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more