pub struct Fragmentainer {
pub size: LogicalSize,
pub used_block_size: f32,
pub is_fixed_size: bool,
pub content: Vec<LayoutBox>,
}Expand description
A single container (fragmentainer) in a fragmentation context.
Each fragmentainer has a logical size and tracks how much of that space has been used. For continuous media, the fragmentainer can grow infinitely. For paged media, fragmentainers have fixed sizes.
Fields§
§size: LogicalSizeLogical size of this container (width and height)
used_block_size: f32How much block-axis space has been used (typically vertical space)
is_fixed_size: boolWhether this container has a fixed size (true for pages) or can grow (false for continuous)
content: Vec<LayoutBox>Content that has been placed in this fragmentainer (populated during layout).
Implementations§
Source§impl Fragmentainer
impl Fragmentainer
Sourcepub fn new(size: LogicalSize, is_fixed_size: bool) -> Self
pub fn new(size: LogicalSize, is_fixed_size: bool) -> Self
Create a new fragmentainer with the given size.
Sourcepub fn remaining_space(&self) -> f32
pub fn remaining_space(&self) -> f32
Get the remaining block-axis space (infinite for continuous, bounded for paged).
Trait Implementations§
Source§impl Clone for Fragmentainer
impl Clone for Fragmentainer
Source§fn clone(&self) -> Fragmentainer
fn clone(&self) -> Fragmentainer
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 moreAuto Trait Implementations§
impl Freeze for Fragmentainer
impl RefUnwindSafe for Fragmentainer
impl Send for Fragmentainer
impl Sync for Fragmentainer
impl Unpin for Fragmentainer
impl UnsafeUnpin for Fragmentainer
impl UnwindSafe for Fragmentainer
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