pub struct PageBreaker { /* private fields */ }Expand description
Page breaker - splits content into pages
Implementations§
Source§impl PageBreaker
impl PageBreaker
Sourcepub fn new(
page_width: Length,
page_height: Length,
margins: [Length; 4],
) -> Self
pub fn new( page_width: Length, page_height: Length, margins: [Length; 4], ) -> Self
Create a new page breaker
Sourcepub fn content_height(&self) -> Length
pub fn content_height(&self) -> Length
Calculate available content height
Sourcepub fn content_height_with_footnotes(&self, footnote_height: Length) -> Length
pub fn content_height_with_footnotes(&self, footnote_height: Length) -> Length
Calculate available content height accounting for footnotes
Sourcepub fn content_width(&self) -> Length
pub fn content_width(&self) -> Length
Calculate available content width
Sourcepub fn break_into_pages(
&self,
area_tree: &mut AreaTree,
root_id: AreaId,
) -> Result<Vec<AreaId>>
pub fn break_into_pages( &self, area_tree: &mut AreaTree, root_id: AreaId, ) -> Result<Vec<AreaId>>
Break an area tree into pages
Sourcepub fn place_footnotes(
&self,
area_tree: &mut AreaTree,
page_id: AreaId,
) -> Result<()>
pub fn place_footnotes( &self, area_tree: &mut AreaTree, page_id: AreaId, ) -> Result<()>
Place footnotes at bottom of page with separator line
Sourcepub fn fits_on_page(
&self,
current_height: Length,
content_height: Length,
) -> bool
pub fn fits_on_page( &self, current_height: Length, content_height: Length, ) -> bool
Check if content fits on current page
Auto Trait Implementations§
impl Freeze for PageBreaker
impl RefUnwindSafe for PageBreaker
impl Send for PageBreaker
impl Sync for PageBreaker
impl Unpin for PageBreaker
impl UnsafeUnpin for PageBreaker
impl UnwindSafe for PageBreaker
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 more