pub enum FragmentationContext {
Continuous {
width: f32,
},
Paged {
page_size: LogicalSize,
},
}Expand description
Selects how content is fragmented during layout.
This is the core abstraction for fragmentation support:
- Screen rendering:
Continuous— a single infinite container. - Print rendering:
Paged— a series of fixed-size page containers.
Variants§
Continuous
Continuous media (screen): a single, infinitely tall container.
Used for normal screen rendering where content can scroll indefinitely; breaks are never forced.
Paged
Paged media (print): fixed-size pages.
Used for PDF generation and print preview. Content flows from one page to the next when a page is full.
Fields
§
page_size: LogicalSizeSize of each page.
Implementations§
Source§impl FragmentationContext
impl FragmentationContext
Sourcepub const fn new_continuous(width: f32) -> FragmentationContext
pub const fn new_continuous(width: f32) -> FragmentationContext
Create a continuous fragmentation context for screen rendering.
Sourcepub const fn new_paged(page_size: LogicalSize) -> FragmentationContext
pub const fn new_paged(page_size: LogicalSize) -> FragmentationContext
Create a paged fragmentation context for print rendering.
Sourcepub const fn page_content_height(&self) -> f32
pub const fn page_content_height(&self) -> f32
Get the page content height (page height for paged media).
For continuous media, returns f32::MAX.
Trait Implementations§
Source§impl Clone for FragmentationContext
impl Clone for FragmentationContext
Source§fn clone(&self) -> FragmentationContext
fn clone(&self) -> FragmentationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FragmentationContext
Auto Trait Implementations§
impl Freeze for FragmentationContext
impl RefUnwindSafe for FragmentationContext
impl Send for FragmentationContext
impl Sync for FragmentationContext
impl Unpin for FragmentationContext
impl UnsafeUnpin for FragmentationContext
impl UnwindSafe for FragmentationContext
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> 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