pub struct ContainerCtx<'a> { /* private fields */ }Expand description
Closure context for building container children.
Errors are deferred: operations no-op after the first failure. The error is surfaced when the parent collects children.
Implementations§
Source§impl ContainerCtx<'_>
impl ContainerCtx<'_>
Sourcepub fn panel(&mut self, kind: impl Into<Arc<str>>) -> PanelId
pub fn panel(&mut self, kind: impl Into<Arc<str>>) -> PanelId
Create a panel inline with grow(1.0) default constraints.
Sourcepub fn panel_with(
&mut self,
kind: impl Into<Arc<str>>,
constraints: Constraints,
) -> PanelId
pub fn panel_with( &mut self, kind: impl Into<Arc<str>>, constraints: Constraints, ) -> PanelId
Create a panel inline with explicit constraints.
Sourcepub fn row(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn row(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
Create a nested row container with zero gap.
Sourcepub fn row_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn row_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
Create a nested row container with the specified gap.
Sourcepub fn col(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn col(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))
Create a nested column container with zero gap.
Sourcepub fn col_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
pub fn col_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))
Create a nested column container with the specified gap.
Sourcepub fn taffy_node(
&mut self,
style: Style,
f: impl FnOnce(&mut ContainerCtx<'_>),
)
pub fn taffy_node( &mut self, style: Style, f: impl FnOnce(&mut ContainerCtx<'_>), )
Escape hatch: insert a raw Taffy node with a custom style.
Auto Trait Implementations§
impl<'a> Freeze for ContainerCtx<'a>
impl<'a> RefUnwindSafe for ContainerCtx<'a>
impl<'a> !Send for ContainerCtx<'a>
impl<'a> !Sync for ContainerCtx<'a>
impl<'a> Unpin for ContainerCtx<'a>
impl<'a> UnsafeUnpin for ContainerCtx<'a>
impl<'a> !UnwindSafe for ContainerCtx<'a>
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