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>
impl<'layout, Config> CotisLayoutRun<'layout, Config>
Sourcepub fn new(layout_manager: &'layout mut CotisLayoutManager) -> Self
pub fn new(layout_manager: &'layout mut CotisLayoutManager) -> Self
Starts a new frame: clears the live tree and opens the root element.
Sourcepub fn get_tree_cursor(&mut self) -> LayoutTreeCursor<'_>
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).
Sourcepub fn new_child_element(&mut self)
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.
Sourcepub fn set_open_element_config(
&mut self,
config: LayoutElementConfig,
id: ElementId,
name: Option<OwnedOrRef<'_, str>>,
true_config: Config,
)
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.
Sourcepub fn open_element_id(&self) -> ElementId
pub fn open_element_id(&self) -> ElementId
Sourcepub fn close_open_element(&mut self)
pub fn close_open_element(&mut self)
Finalizes sizing for the open element and moves the cursor to its parent.
Sourcepub fn finalize_layouts(&mut self) -> Vec<RenderCommandOutput<Config>>
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.
Sourcepub fn remove_custom(&mut self, element_id: ElementId) -> Config
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>,
impl<'name, T> ConfigureElements<T> for CotisLayoutRun<'_, T>where
T: CotisLayoutCompatible<'name>,
Source§fn open_new_element(&mut self, _: Seal)
fn open_new_element(&mut self, _: Seal)
fn set_config(&mut self, config: T, _: Seal)
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>>
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)
fn set_leaf_config(&mut self, leaf: TextElementConfig<'frame>, _: Seal)
Source§impl<'frame, I, C, E: 'frame + Sync + Send> ConfigureLeafElements<TextElementConfig<'frame>> for CotisLayoutRun<'_, ElementConfig<'frame, DoubleAxisSizing, I, C, E>>
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)
fn set_leaf_config(&mut self, leaf: TextElementConfig<'frame>, _: Seal)
Source§impl<'frame, T> LayoutFrameManager<'frame, T, RenderCommandOutput<T>, CotisLayoutRun<'_, T>> for CotisLayoutRun<'_, T>where
T: CotisLayoutCompatible<'frame> + 'frame,
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>
fn begin(&mut self) -> ConfiguredParentElement<'_, Self, T>
Source§fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>
fn end(self) -> impl Iterator<Item = RenderCommandOutput<T>>
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> 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
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
self into Target.