Skip to main content

CotisLayoutRun

Struct CotisLayoutRun 

Source
pub struct CotisLayoutRun<'layout, Config> { /* private fields */ }
Expand description

Per-frame element tree configurator returned by LayoutManager::begin_frame.

Implements ConfigureElements when Config implements CotisLayoutCompatible. Call LayoutFrameManager::end (or finalize_layouts directly) to run layout and obtain RenderCommandOutput values.

Implementations§

Source§

impl<'layout, Config> CotisLayoutRun<'layout, Config>

Source

pub fn new(layout_manager: &'layout mut CotisLayoutManager) -> Self

Starts a new frame: clears the live tree and opens the root element.

Source

pub fn get_tree_cursor(&mut self) -> LayoutTreeCursor<'_>

Returns a mutable cursor to the currently open element in the layout tree.

§Panics

Panics if the open element index is invalid (internal inconsistency).

Source

pub fn new_child_element(&mut self)

Adds a new child under the currently open element and opens it.

§Panics

Panics if the open element no longer exists in the tree.

Source

pub fn set_open_element_config( &mut self, config: LayoutElementConfig, id: ElementId, name: Option<OwnedOrRef<'_, str>>, true_config: Config, )

Applies layout style and user config to the currently open element, then initializes sizing state.

Called internally by ConfigureElements::set_config.

§Panics

Panics if no element is open.

Source

pub fn open_element_id(&self) -> ElementId

Returns the ElementId of the currently open tree node.

§Panics

Panics if no element is open.

Source

pub fn close_open_element(&mut self)

Finalizes sizing for the open element and moves the cursor to its parent.

Source

pub fn finalize_layouts(&mut self) -> Vec<RenderCommandOutput<Config>>

Runs the full layout pipeline and returns render commands for this frame.

Order: fit/grow/shrink (width) → text wrap → fit/grow/shrink (height) → positioning → render command emission. Clears the live tree and populates the manager’s element cache for inspection traits.

Prefer LayoutFrameManager::end when using the standard Cotis frame API.

Source

pub fn remove_custom(&mut self, element_id: ElementId) -> Config

Removes and returns the user config for element_id after render command extraction.

§Panics

Panics if no config exists for element_id.

Trait Implementations§

Source§

impl<'name, T> ConfigureElements<T> for CotisLayoutRun<'_, T>
where T: CotisLayoutCompatible<'name>,

Source§

fn open_new_element(&mut self, _: Seal)

Signals the start of a new element Read more
Source§

fn set_config(&mut self, config: T, _: Seal)

Source§

fn close_element(&mut self, _: Seal)

Source§

impl<'frame, I, C, E: 'frame + Sync + Send> ConfigureLeafElements<TextElementConfig<'frame>> for CotisLayoutRun<'_, ElementConfig<'frame, Sizing, I, C, E>>

Source§

fn set_leaf_config(&mut self, leaf: TextElementConfig<'frame>, _: Seal)

Sets configuration intended for leaf-only element data.
Source§

impl<'frame, I, C, E: 'frame + Sync + Send> ConfigureLeafElements<TextElementConfig<'frame>> for CotisLayoutRun<'_, ElementConfig<'frame, DoubleAxisSizing, I, C, E>>

Source§

fn set_leaf_config(&mut self, leaf: TextElementConfig<'frame>, _: Seal)

Sets configuration intended for leaf-only element data.
Source§

impl<'frame, T> LayoutFrameManager<'frame, T, RenderCommandOutput<T>, CotisLayoutRun<'_, T>> for CotisLayoutRun<'_, T>
where T: CotisLayoutCompatible<'frame> + 'frame,

Source§

fn begin(&mut self) -> ConfiguredParentElement<'_, Self, T>

Begins configuration at the root of the UI tree for this frame.
Source§

fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>

Completes frame construction and returns the frame output iterator.

Auto Trait Implementations§

§

impl<'layout, Config> !RefUnwindSafe for CotisLayoutRun<'layout, Config>

§

impl<'layout, Config> !Send for CotisLayoutRun<'layout, Config>

§

impl<'layout, Config> !Sync for CotisLayoutRun<'layout, Config>

§

impl<'layout, Config> !UnwindSafe for CotisLayoutRun<'layout, Config>

§

impl<'layout, Config> Freeze for CotisLayoutRun<'layout, Config>

§

impl<'layout, Config> Unpin for CotisLayoutRun<'layout, Config>
where Config: Unpin,

§

impl<'layout, Config> UnsafeUnpin for CotisLayoutRun<'layout, Config>

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<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Source
where TailTarget: IsRenderList, Source: Embed<TailTarget, Idx>,

Source§

fn embed(self) -> RenderTList<H, TailTarget>

Converts self into Target.
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.