pub struct MultiColumnLayout {
pub column_count: i32,
pub column_gap: Length,
pub available_width: Length,
pub column_width: Length,
pub current_column: i32,
pub column_y: Length,
pub max_column_height: Option<Length>,
}Expand description
Multi-column layout configuration
Handles layout of content across multiple columns per CSS Multi-column Layout Module Level 1 specification.
Fields§
§column_count: i32Number of columns
column_gap: LengthGap between columns
available_width: LengthTotal available width
column_width: LengthWidth of each column
current_column: i32Current column index (0-based)
column_y: LengthCurrent Y position within the current column
max_column_height: Option<Length>Maximum height per column (when page height is known)
Implementations§
Source§impl MultiColumnLayout
impl MultiColumnLayout
Sourcepub fn new(
column_count: i32,
column_gap: Length,
available_width: Length,
) -> Self
pub fn new( column_count: i32, column_gap: Length, available_width: Length, ) -> Self
Create a new multi-column layout
Sourcepub fn with_max_height(self, max_height: Length) -> Self
pub fn with_max_height(self, max_height: Length) -> Self
Set the maximum column height (for balancing and page breaks)
Sourcepub fn current_column_x(&self) -> Length
pub fn current_column_x(&self) -> Length
Get the X offset for the current column
Sourcepub fn is_column_filled(&self, content_height: Length) -> bool
pub fn is_column_filled(&self, content_height: Length) -> bool
Check if the current column is filled (exceeds max height)
Sourcepub fn next_column(&mut self) -> bool
pub fn next_column(&mut self) -> bool
Move to the next column
Sourcepub fn allocate(&mut self, height: Length) -> (Length, Length)
pub fn allocate(&mut self, height: Length) -> (Length, Length)
Allocate space in the current column
Sourcepub fn column_count(&self) -> i32
pub fn column_count(&self) -> i32
Get the number of columns
Sourcepub fn column_width(&self) -> Length
pub fn column_width(&self) -> Length
Get the width of each column
Trait Implementations§
Source§impl Clone for MultiColumnLayout
impl Clone for MultiColumnLayout
Source§fn clone(&self) -> MultiColumnLayout
fn clone(&self) -> MultiColumnLayout
Returns a duplicate of the value. Read more
1.0.0 · 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 MultiColumnLayout
impl RefUnwindSafe for MultiColumnLayout
impl Send for MultiColumnLayout
impl Sync for MultiColumnLayout
impl Unpin for MultiColumnLayout
impl UnsafeUnpin for MultiColumnLayout
impl UnwindSafe for MultiColumnLayout
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