pub struct Layout { /* private fields */ }Expand description
An immutable, validated layout ready for resolution.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn tree(&self) -> &LayoutTree
pub fn tree(&self) -> &LayoutTree
Borrow the underlying tree for read-only traversal.
Sourcepub fn window_size(&self) -> usize
pub fn window_size(&self) -> usize
How many panels the active window shows at once.
Sourcepub fn resolve(
&self,
width: f32,
height: f32,
) -> Result<ResolvedLayout, PaneError>
pub fn resolve( &self, width: f32, height: f32, ) -> Result<ResolvedLayout, PaneError>
Compile, compute, and resolve the layout at the given viewport size.
Sourcepub fn build_row(
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<Self, PaneError>
pub fn build_row( f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<Self, PaneError>
Build a row layout from a closure.
Sourcepub fn build_col(
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<Self, PaneError>
pub fn build_col( f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<Self, PaneError>
Build a column layout from a closure.
Sourcepub fn build_row_gap(
gap: f32,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<Self, PaneError>
pub fn build_row_gap( gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<Self, PaneError>
Build a row layout with gap from a closure.
Sourcepub fn build_col_gap(
gap: f32,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<Self, PaneError>
pub fn build_col_gap( gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<Self, PaneError>
Build a column layout with gap from a closure.
Sourcepub fn row(
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> Result<Self, PaneError>
pub fn row( kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Result<Self, PaneError>
Equal-grow panels in a row, zero gap.
Sourcepub fn col(
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> Result<Self, PaneError>
pub fn col( kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Result<Self, PaneError>
Equal-grow panels in a column, zero gap.
Sourcepub fn row_with(
panels: impl IntoIterator<Item = (impl Into<Arc<str>>, Constraints)>,
) -> Result<Self, PaneError>
pub fn row_with( panels: impl IntoIterator<Item = (impl Into<Arc<str>>, Constraints)>, ) -> Result<Self, PaneError>
Panels in a row with explicit constraints per panel.
Sourcepub fn col_with(
panels: impl IntoIterator<Item = (impl Into<Arc<str>>, Constraints)>,
) -> Result<Self, PaneError>
pub fn col_with( panels: impl IntoIterator<Item = (impl Into<Arc<str>>, Constraints)>, ) -> Result<Self, PaneError>
Panels in a column with explicit constraints per panel.
Sourcepub fn presets() -> &'static [PresetInfo]
pub fn presets() -> &'static [PresetInfo]
Return metadata for all built-in presets, sorted alphabetically by name.
Sourcepub fn master_stack(
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> MasterStack
pub fn master_stack( kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> MasterStack
Create a MasterStack builder.
Sourcepub fn centered_master(
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> CenteredMaster
pub fn centered_master( kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> CenteredMaster
Create a CenteredMaster builder.
Sourcepub fn monocle(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Monocle
pub fn monocle(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Monocle
Create a Monocle builder.
Sourcepub fn scrollable(
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> Scrollable
pub fn scrollable( kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Scrollable
Create a Scrollable builder.
Sourcepub fn dwindle(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Dwindle
pub fn dwindle(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Dwindle
Create a Dwindle builder.
Sourcepub fn spiral(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Spiral
pub fn spiral(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Spiral
Create a Spiral builder.
Sourcepub fn columns(
count: usize,
kinds: impl IntoIterator<Item = impl Into<Arc<str>>>,
) -> Columns
pub fn columns( count: usize, kinds: impl IntoIterator<Item = impl Into<Arc<str>>>, ) -> Columns
Create a Columns builder.
Sourcepub fn deck(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Deck
pub fn deck(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Deck
Create a Deck builder.
Sourcepub fn tabbed(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Tabbed
pub fn tabbed(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Tabbed
Create a Tabbed builder.
Sourcepub fn stacked(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Stacked
pub fn stacked(kinds: impl IntoIterator<Item = impl Into<Arc<str>>>) -> Stacked
Create a Stacked builder.
Create a Sidebar builder.
Sourcepub fn holy_grail(
header: impl Into<Arc<str>>,
footer: impl Into<Arc<str>>,
left: impl Into<Arc<str>>,
main: impl Into<Arc<str>>,
right: impl Into<Arc<str>>,
) -> HolyGrail
pub fn holy_grail( header: impl Into<Arc<str>>, footer: impl Into<Arc<str>>, left: impl Into<Arc<str>>, main: impl Into<Arc<str>>, right: impl Into<Arc<str>>, ) -> HolyGrail
Create a HolyGrail builder.
Sourcepub fn dashboard(
cards: impl IntoIterator<Item = (impl Into<Arc<str>>, usize)>,
) -> Dashboard
pub fn dashboard( cards: impl IntoIterator<Item = (impl Into<Arc<str>>, usize)>, ) -> Dashboard
Create a Dashboard builder.