pub struct LayoutBuilder { /* private fields */ }Expand description
Ergonomic builder for constructing layouts.
Users create panels, arrange them in row()/col() containers via closures,
then call build() to get a Layout ready for resolution.
Implementations§
Source§impl LayoutBuilder
impl LayoutBuilder
Sourcepub fn panel(&mut self, kind: impl Into<Arc<str>>) -> Result<PanelId, PaneError>
pub fn panel(&mut self, kind: impl Into<Arc<str>>) -> Result<PanelId, PaneError>
Create a panel with grow(1.0) default constraints.
Sourcepub fn panel_with(
&mut self,
kind: impl Into<Arc<str>>,
constraints: Constraints,
) -> Result<PanelId, PaneError>
pub fn panel_with( &mut self, kind: impl Into<Arc<str>>, constraints: Constraints, ) -> Result<PanelId, PaneError>
Create a panel with explicit constraints.
Sourcepub fn row(
&mut self,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<(), PaneError>
pub fn row( &mut self, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<(), PaneError>
Set the root to a row container with zero gap.
Sourcepub fn row_gap(
&mut self,
gap: f32,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<(), PaneError>
pub fn row_gap( &mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<(), PaneError>
Set the root to a row container with the specified gap.
Sourcepub fn col(
&mut self,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<(), PaneError>
pub fn col( &mut self, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<(), PaneError>
Set the root to a column container with zero gap.
Sourcepub fn col_gap(
&mut self,
gap: f32,
f: impl FnOnce(&mut ContainerCtx<'_>),
) -> Result<(), PaneError>
pub fn col_gap( &mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>), ) -> Result<(), PaneError>
Set the root to a column container with the specified gap.
Sourcepub fn set_window_size(&mut self, size: usize)
pub fn set_window_size(&mut self, size: usize)
Consume the builder, validate the tree, and return a Layout.
Set how many panels the active window shows at once.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayoutBuilder
impl RefUnwindSafe for LayoutBuilder
impl !Send for LayoutBuilder
impl !Sync for LayoutBuilder
impl Unpin for LayoutBuilder
impl UnsafeUnpin for LayoutBuilder
impl UnwindSafe for LayoutBuilder
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