Skip to main content

Module layout

Module layout 

Source
Expand description

Native GUI owned layout types, geometry, and style specification.

Provides backend-agnostic layout structures for the repository-owned layout engine.

§Architecture

Re-exports§

pub use box_sizing::apply_relative_offset;
pub use box_sizing::compute_box_sizing;
pub use box_sizing::resolve_absolute_position;
pub use box_sizing::resolve_box_constraints;
pub use box_sizing::resolve_dimension;
pub use box_sizing::resolve_inset;
pub use box_sizing::resolve_margin;
pub use box_sizing::resolve_padding;
pub use box_sizing::BoxConstraints;
pub use box_sizing::BoxDimensions;
pub use box_sizing::Measurer;
pub use box_sizing::TextMeasurementCache;
pub use box_sizing::MAX_LAYOUT_DEPTH;
pub use box_sizing::STRICT_TOLERANCE_PX;
pub use flex::compute_flex;
pub use flex::compute_multi_line_flex;
pub use flex::compute_single_line_flex;
pub use flex::FlexItem;
pub use grid::compute_grid;
pub use tree::AvailableSpaceKey;
pub use tree::CachedLayout;
pub use tree::LayoutCacheKey;
pub use tree::LayoutMetrics;
pub use tree::LayoutNode;
pub use tree::LayoutNodeId;
pub use tree::LayoutTree;

Modules§

box_sizing
Box sizing, box model constraints, intrinsic measurement, and numerical rules.
flex
Constrained flex layout engine supporting single-line and multi-line wrapping.
grid
Owned native-GUI grid layout solver.
tree
Native GUI owned layout tree, mutation invariants, and cache lifecycle.

Structs§

GridPlacement
Grid item coordinate placement.
LayoutRect
Computed layout rectangle in logical coordinates.
Point
A 2D point with x and y coordinates.
Rect
A four-sided rect used for insets (padding, margin, inset).
Size
A 2D size with width and height components.
Style
Complete layout style specification.

Enums§

AlignContent
Cross-axis distribution of wrapped flex lines.
AlignItems
Cross-axis alignment for items in flex or grid lines.
AlignSelf
Cross-axis alignment override for individual items.
AvailableSpace
Available space passed to intrinsic measurement passes.
Dimension
Sizing dimension supporting auto, explicit length, or percentage.
Display
Container display mode.
FlexDirection
Direction of primary layout axis for flex containers.
FlexWrap
Wrapping behavior along the flex axis.
GridAutoFlow
Grid auto flow direction.
JustifyContent
Main-axis distribution of items.
LengthPercentage
Inset dimension supporting explicit length or percentage.
LengthPercentageAuto
Inset dimension supporting auto, length, or percentage.
Position
Item positioning mode.
TrackSizingFunction
Grid track sizing function.