pub struct PaginationContext<'a> {
pub geometer: &'a PageGeometer,
pub break_avoid_depth: usize,
pub repeated_headers: Vec<RepeatedTableHeader>,
}Expand description
Context for pagination during layout.
This is passed into layout functions to allow them to make page-aware decisions.
Fields§
§geometer: &'a PageGeometerThe page geometry calculator
break_avoid_depth: usizeAccumulated break-inside: avoid depth from ancestors
repeated_headers: Vec<RepeatedTableHeader>Track table headers that need to repeat on new pages
Implementations§
Source§impl<'a> PaginationContext<'a>
impl<'a> PaginationContext<'a>
pub fn new(geometer: &'a PageGeometer) -> Self
Sourcepub fn enter_avoid_break(&mut self)
pub fn enter_avoid_break(&mut self)
Enter a box with break-inside: avoid
Sourcepub fn exit_avoid_break(&mut self)
pub fn exit_avoid_break(&mut self)
Exit a box with break-inside: avoid
Sourcepub fn is_avoiding_breaks(&self) -> bool
pub fn is_avoiding_breaks(&self) -> bool
Check if we’re inside an ancestor with break-inside: avoid
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PaginationContext<'a>
impl<'a> RefUnwindSafe for PaginationContext<'a>
impl<'a> Send for PaginationContext<'a>
impl<'a> Sync for PaginationContext<'a>
impl<'a> Unpin for PaginationContext<'a>
impl<'a> UnsafeUnpin for PaginationContext<'a>
impl<'a> UnwindSafe for PaginationContext<'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
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