pub struct LayoutEngine { /* private fields */ }Expand description
Layout engine with memoization.
Implementations§
Source§impl LayoutEngine
impl LayoutEngine
Sourcepub fn compute(&mut self, root: &mut dyn Widget, viewport: Size) -> LayoutTree
pub fn compute(&mut self, root: &mut dyn Widget, viewport: Size) -> LayoutTree
Compute layout for the widget tree.
This performs a two-phase layout:
- Measure phase (bottom-up): Determine intrinsic sizes
- Layout phase (top-down): Assign final positions and sizes
Sourcepub fn compute_readonly(
&mut self,
root: &dyn Widget,
viewport: Size,
) -> LayoutTree
pub fn compute_readonly( &mut self, root: &dyn Widget, viewport: Size, ) -> LayoutTree
Compute layout with read-only widget tree (for measurement only).
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the layout cache.
Sourcepub const fn cache_stats(&self) -> (usize, usize)
pub const fn cache_stats(&self) -> (usize, usize)
Get cache statistics.
Trait Implementations§
Source§impl Debug for LayoutEngine
impl Debug for LayoutEngine
Source§impl Default for LayoutEngine
impl Default for LayoutEngine
Source§fn default() -> LayoutEngine
fn default() -> LayoutEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayoutEngine
impl RefUnwindSafe for LayoutEngine
impl Send for LayoutEngine
impl Sync for LayoutEngine
impl Unpin for LayoutEngine
impl UnwindSafe for LayoutEngine
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