Skip to main content

ContainerCtx

Struct ContainerCtx 

Source
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<'_>

Source

pub fn add(&mut self, pid: PanelId)

Place a pre-created panel into this container.

Source

pub fn panel(&mut self, kind: impl Into<Arc<str>>) -> PanelId

Create a panel inline with grow(1.0) default constraints.

Source

pub fn panel_with( &mut self, kind: impl Into<Arc<str>>, constraints: Constraints, ) -> PanelId

Create a panel inline with explicit constraints.

Source

pub fn row(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))

Create a nested row container with zero gap.

Source

pub fn row_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))

Create a nested row container with the specified gap.

Source

pub fn col(&mut self, f: impl FnOnce(&mut ContainerCtx<'_>))

Create a nested column container with zero gap.

Source

pub fn col_gap(&mut self, gap: f32, f: impl FnOnce(&mut ContainerCtx<'_>))

Create a nested column container with the specified gap.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.