pub struct AreaTree {
pub document_lang: Option<String>,
/* private fields */
}Expand description
Area tree - arena-allocated tree of areas
Fields§
§document_lang: Option<String>Document language from xml:lang on fo:root (for PDF /Lang entry)
Implementations§
Source§impl AreaTree
impl AreaTree
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create an area tree with preallocated capacity
Sourcepub fn get_mut(&mut self, id: AreaId) -> Option<&mut AreaNode>
pub fn get_mut(&mut self, id: AreaId) -> Option<&mut AreaNode>
Get a mutable reference to an area by ID
Sourcepub fn append_child(
&mut self,
parent: AreaId,
child: AreaId,
) -> Result<(), String>
pub fn append_child( &mut self, parent: AreaId, child: AreaId, ) -> Result<(), String>
Append a child area to a parent
Sourcepub fn add_footnote(&mut self, page_id: AreaId, footnote_id: AreaId)
pub fn add_footnote(&mut self, page_id: AreaId, footnote_id: AreaId)
Add a footnote to a page
Sourcepub fn find_page_ancestor(&self, area_id: AreaId) -> Option<AreaId>
pub fn find_page_ancestor(&self, area_id: AreaId) -> Option<AreaId>
Find the nearest Page ancestor for a given area (or the area itself if it’s a Page)
Sourcepub fn serialize(&self) -> String
pub fn serialize(&self) -> String
Serialize the area tree as an indented text tree for debugging
Sourcepub fn footnote_height(&self, page_id: AreaId) -> Length
pub fn footnote_height(&self, page_id: AreaId) -> Length
Calculate total height of footnotes for a page
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AreaTree
impl RefUnwindSafe for AreaTree
impl Send for AreaTree
impl Sync for AreaTree
impl Unpin for AreaTree
impl UnsafeUnpin for AreaTree
impl UnwindSafe for AreaTree
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> 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().