pub struct LayoutEngine { /* private fields */ }Expand description
Deterministic cross-platform Flexbox, Grid, Block, and Positioned layout engine.
Implementations§
Source§impl LayoutEngine
Core layout solver, split cache management, and spatial hit-testing operations for LayoutEngine.
impl LayoutEngine
Core layout solver, split cache management, and spatial hit-testing operations for LayoutEngine.
Sourcepub fn compute(&mut self, tree: &mut SceneTree, viewport: Size) -> LayoutStats
pub fn compute(&mut self, tree: &mut SceneTree, viewport: Size) -> LayoutStats
Sourcepub fn layout_telemetry(&self) -> LayoutTelemetry
pub fn layout_telemetry(&self) -> LayoutTelemetry
Sourcepub fn reset_telemetry(&mut self)
pub fn reset_telemetry(&mut self)
Sourcepub fn split_cache_stats(&self) -> SplitCacheStats
pub fn split_cache_stats(&self) -> SplitCacheStats
Sourcepub fn subtree_bounds(&self, node_id: NodeId) -> Option<Rect>
pub fn subtree_bounds(&self, node_id: NodeId) -> Option<Rect>
Sourcepub fn hit_test(&self, tree: &SceneTree, point: Point) -> Option<NodeId>
pub fn hit_test(&self, tree: &SceneTree, point: Point) -> Option<NodeId>
Performs zero-allocation spatial hit-testing accelerated by cached subtree_bounds and has_nonzero_z_child.
§Arguments
&Self- Layout engine reference owning the spatial cache.&SceneTree- Retained scene tree after layout.Point- Logical pointer coordinates in root space.
§Returns
Option<NodeId>- Topmost matching node handle, if any.
Sourcepub fn hit_test_with_visited(
&self,
tree: &SceneTree,
point: Point,
) -> (Option<NodeId>, usize)
pub fn hit_test_with_visited( &self, tree: &SceneTree, point: Point, ) -> (Option<NodeId>, usize)
Performs zero-allocation spatial hit-testing and also returns the number of inspected scene nodes.
§Arguments
&Self- Layout engine reference owning the spatial cache.&SceneTree- Retained scene tree after layout.Point- Logical pointer coordinates in root space.
§Returns
(Option<NodeId>, usize)- Pair of(topmost_hit, nodes_visited).
Source§impl LayoutEngine
impl LayoutEngine
pub fn get_measurer(&self) -> DeterministicTextMeasurer
pub fn get_mut_measurer(&mut self) -> &mut DeterministicTextMeasurer
pub fn set_measurer(&mut self, val: DeterministicTextMeasurer) -> &mut Self
pub fn get_last_stats(&self) -> LayoutStats
pub fn get_mut_last_stats(&mut self) -> &mut LayoutStats
pub fn set_last_stats(&mut self, val: LayoutStats) -> &mut Self
pub fn get_telemetry(&self) -> LayoutTelemetry
pub fn get_mut_telemetry(&mut self) -> &mut LayoutTelemetry
pub fn set_telemetry(&mut self, val: LayoutTelemetry) -> &mut Self
Trait Implementations§
Source§impl Clone for LayoutEngine
impl Clone for LayoutEngine
Source§impl Debug for LayoutEngine
impl Debug for LayoutEngine
Auto Trait Implementations§
impl Forget for LayoutEngine
impl Freeze for LayoutEnginewhere
*const u8 is !null: Freeze,
PhantomData<NodeId>: Freeze,
PhantomData<FlexItemRecord>: Freeze,
PhantomData<(usize, usize)>: Freeze,
PhantomData<TextSizeEntry>: Freeze,
PhantomData<LayoutNodeSnapshot>: Freeze,
PhantomData<u32>: Freeze,
PhantomData<[MeasureCacheSlot; 4]>: Freeze,
PhantomData<Option<FinalLayoutSlot>>: Freeze,
PhantomData<NodeTextHashSlot>: Freeze,
PhantomData<Rect>: Freeze,
PhantomData<u8>: Freeze,
impl Move for LayoutEngine
impl RefUnwindSafe for LayoutEngine
impl Send for LayoutEnginewhere
RawVecInner: Send,
impl Sync for LayoutEnginewhere
RawVecInner: Sync,
impl Unpin for LayoutEngine
impl UnsafeUnpin for LayoutEnginewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<NodeId>: UnsafeUnpin,
PhantomData<FlexItemRecord>: UnsafeUnpin,
PhantomData<(usize, usize)>: UnsafeUnpin,
PhantomData<TextSizeEntry>: UnsafeUnpin,
PhantomData<LayoutNodeSnapshot>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<[MeasureCacheSlot; 4]>: UnsafeUnpin,
PhantomData<Option<FinalLayoutSlot>>: UnsafeUnpin,
PhantomData<NodeTextHashSlot>: UnsafeUnpin,
PhantomData<Rect>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for LayoutEnginewhere
RawVecInner: UnwindSafe,
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