pub struct StructTree {
pub role_map: RoleMap,
/* private fields */
}Expand description
Structure tree - hierarchical organization of document structure
The structure tree describes the logical organization of content in a tagged PDF document.
Fields§
§role_map: RoleMapRole map for custom structure types
Implementations§
Source§impl StructTree
impl StructTree
Sourcepub fn set_root(&mut self, element: StructureElement) -> usize
pub fn set_root(&mut self, element: StructureElement) -> usize
Adds a root element to the tree (typically Document)
Sourcepub fn add_child(
&mut self,
parent_index: usize,
element: StructureElement,
) -> Result<usize, String>
pub fn add_child( &mut self, parent_index: usize, element: StructureElement, ) -> Result<usize, String>
Adds an element as a child of another element
Sourcepub fn get(&self, index: usize) -> Option<&StructureElement>
pub fn get(&self, index: usize) -> Option<&StructureElement>
Gets an element by index
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut StructureElement>
pub fn get_mut(&mut self, index: usize) -> Option<&mut StructureElement>
Gets a mutable reference to an element by index
Sourcepub fn get_by_id(&self, id: &str) -> Option<&StructureElement>
pub fn get_by_id(&self, id: &str) -> Option<&StructureElement>
Gets an element by ID
Sourcepub fn root_index(&self) -> Option<usize>
pub fn root_index(&self) -> Option<usize>
Gets the root element index
Sourcepub fn root(&self) -> Option<&StructureElement>
pub fn root(&self) -> Option<&StructureElement>
Gets the root element
Sourcepub fn iter(&self) -> impl Iterator<Item = &StructureElement>
pub fn iter(&self) -> impl Iterator<Item = &StructureElement>
Returns an iterator over all elements
Trait Implementations§
Source§impl Clone for StructTree
impl Clone for StructTree
Source§fn clone(&self) -> StructTree
fn clone(&self) -> StructTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructTree
impl Debug for StructTree
Auto Trait Implementations§
impl Freeze for StructTree
impl RefUnwindSafe for StructTree
impl Send for StructTree
impl Sync for StructTree
impl Unpin for StructTree
impl UnwindSafe for StructTree
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().