pub struct ItemTree {
pub items: Vec<TreeItem>,
pub body: Vec<usize>,
}Expand description
docling’s item tree in creation order (see the module docs).
Fields§
§items: Vec<TreeItem>Every item, indexed by creation order — which is how docling numbers
#/texts/N, #/groups/N, … within each bucket.
body: Vec<usize>The body’s children, as item indices.
Implementations§
Source§impl ItemTree
impl ItemTree
Sourcepub fn add(
&mut self,
parent: Option<usize>,
layer: Option<ContentLayer>,
kind: TreeKind,
) -> usize
pub fn add( &mut self, parent: Option<usize>, layer: Option<ContentLayer>, kind: TreeKind, ) -> usize
Append an item under parent (None = body) on layer, registering
it as its parent’s last child — docling’s add_* calls do exactly that.
Sourcepub fn reparent(&mut self, id: usize, new_parent: Option<usize>)
pub fn reparent(&mut self, id: usize, new_parent: Option<usize>)
Move id under new_parent, dropping it from its current parent’s
children and appending it to the new one’s — docling’s
group_cell_elements re-parenting of a rich cell’s items.
Sourcepub fn bucket_index(&self, id: usize) -> usize
pub fn bucket_index(&self, id: usize) -> usize
How many items of a bucket precede id — its #/{bucket}/N index.
Sourcepub fn table_count(&self) -> usize
pub fn table_count(&self) -> usize
The number of tables created so far (docling’s len(doc.tables)).
Trait Implementations§
impl StructuralPartialEq for ItemTree
Auto Trait Implementations§
impl Freeze for ItemTree
impl RefUnwindSafe for ItemTree
impl Send for ItemTree
impl Sync for ItemTree
impl Unpin for ItemTree
impl UnsafeUnpin for ItemTree
impl UnwindSafe for ItemTree
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