pub struct SubcomposeLayoutNode { /* private fields */ }Expand description
Node responsible for orchestrating measure-time subcomposition.
Implementations§
Source§impl SubcomposeLayoutNode
impl SubcomposeLayoutNode
pub fn new( modifier: Modifier, measure_policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>, ) -> Self
Sourcepub fn with_content_type_policy(
modifier: Modifier,
measure_policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>,
) -> Self
pub fn with_content_type_policy( modifier: Modifier, measure_policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>, ) -> Self
Creates a SubcomposeLayoutNode with ContentTypeReusePolicy.
Use this for lazy lists to enable content-type-aware slot reuse. Slots with matching content types can reuse each other’s nodes, improving efficiency when scrolling through items with different types.
pub fn handle(&self) -> SubcomposeLayoutNodeHandle
pub fn set_measure_policy( &mut self, policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>, )
Sourcepub fn set_captured_context(&mut self, context: CapturedCompositionContext)
pub fn set_captured_context(&mut self, context: CapturedCompositionContext)
Records the source composition context for measure-time subcomposition.
Sourcepub fn set_density(&mut self, density: Density)
pub fn set_density(&mut self, density: Density)
Records the grid the composition provided, re-measuring if it moved.
Mirrors LayoutNode::set_density:
SubcomposeLayout captures this at the same composition site that
captures the subcomposition context, so the two cannot disagree.
Sourcepub fn set_layout_direction(&mut self, direction: LayoutDirection)
pub fn set_layout_direction(&mut self, direction: LayoutDirection)
Updates relative modifier placement for this node’s composition scope.
pub fn set_modifier(&mut self, modifier: Modifier)
pub fn set_debug_modifiers(&mut self, enabled: bool)
pub fn modifier(&self) -> Modifier
pub fn resolved_modifiers(&self) -> ResolvedModifiers
Sourcepub fn layout_state(&self) -> LayoutState
pub fn layout_state(&self) -> LayoutState
Returns a clone of the current layout state.
Sourcepub fn set_position(&self, position: Point)
pub fn set_position(&self, position: Point)
Updates the position of this node. Called during placement.
LayoutState::place self-reports actual moves to the scene phase.
Sourcepub fn set_measured_size(&self, size: Size)
pub fn set_measured_size(&self, size: Size)
Updates the measured size of this node. Called during measurement.
LayoutState::set_size self-reports actual changes to the scene
phase.
Sourcepub fn clear_placed(&self)
pub fn clear_placed(&self)
Clears the is_placed flag. Called at the start of a layout pass.
Sourcepub fn semantics_configuration(&self) -> Option<SemanticsConfiguration>
pub fn semantics_configuration(&self) -> Option<SemanticsConfiguration>
Semantics reported by this node’s live modifier chain.
Sourcepub fn semantics_reach(&self) -> SemanticsReach
pub fn semantics_reach(&self) -> SemanticsReach
Whether this node’s modifiers make it modal or hidden.
Sourcepub fn modifier_slices_snapshot(&self) -> Rc<ModifierNodeSlices>
pub fn modifier_slices_snapshot(&self) -> Rc<ModifierNodeSlices>
Returns the modifier slices snapshot for rendering.
pub fn state(&self) -> Ref<'_, SubcomposeState>
pub fn state_mut(&self) -> RefMut<'_, SubcomposeState>
pub fn invalidate_subcomposition(&self)
pub fn request_measure_recompose(&self)
Sourcepub fn with_active_children<R>(&self, f: impl FnOnce(&[NodeId]) -> R) -> R
pub fn with_active_children<R>(&self, f: impl FnOnce(&[NodeId]) -> R) -> R
Calls f with the children this node placed in its last layout, in
placement order, without copying them.
Changes through a node handle during f become visible to the next
read; this read keeps its original children.
Sourcepub fn mark_needs_measure(&self)
pub fn mark_needs_measure(&self)
Mark this node as needing measure. Also marks it as needing layout.
Sourcepub fn mark_needs_layout_flag(&self)
pub fn mark_needs_layout_flag(&self)
Mark this node as needing layout (but not necessarily measure).
Sourcepub fn mark_needs_redraw(&self)
pub fn mark_needs_redraw(&self)
Mark this node as needing redraw without forcing measure/layout.
Sourcepub fn needs_measure(&self) -> bool
pub fn needs_measure(&self) -> bool
Check if this node needs measure.
Sourcepub fn mark_needs_semantics(&self)
pub fn mark_needs_semantics(&self)
Mark this node as needing semantics recomputation.
Sourcepub fn needs_redraw(&self) -> bool
pub fn needs_redraw(&self) -> bool
Returns true when this node requested a redraw since the last render pass.
pub fn clear_needs_redraw(&self)
Sourcepub fn mark_needs_pointer_pass(&self)
pub fn mark_needs_pointer_pass(&self)
Marks this node as needing a fresh pointer-input pass.
Sourcepub fn needs_pointer_pass(&self) -> bool
pub fn needs_pointer_pass(&self) -> bool
Returns true when pointer-input state needs to be recomputed.
Sourcepub fn clear_needs_pointer_pass(&self)
pub fn clear_needs_pointer_pass(&self)
Clears the pointer-input dirty flag after hosts service it.
Sourcepub fn mark_needs_focus_sync(&self)
pub fn mark_needs_focus_sync(&self)
Marks this node as needing a focus synchronization.
Sourcepub fn needs_focus_sync(&self) -> bool
pub fn needs_focus_sync(&self) -> bool
Returns true when focus state needs to be synchronized.
Sourcepub fn clear_needs_focus_sync(&self)
pub fn clear_needs_focus_sync(&self)
Clears the focus dirty flag after the focus manager processes it.
Sourcepub fn modifier_capabilities(&self) -> NodeCapabilities
pub fn modifier_capabilities(&self) -> NodeCapabilities
Returns the modifier capabilities for this node.
pub fn has_layout_modifier_nodes(&self) -> bool
pub fn has_draw_modifier_nodes(&self) -> bool
pub fn has_pointer_input_modifier_nodes(&self) -> bool
pub fn has_semantics_modifier_nodes(&self) -> bool
pub fn has_focus_modifier_nodes(&self) -> bool
Trait Implementations§
Source§impl Node for SubcomposeLayoutNode
impl Node for SubcomposeLayoutNode
Source§fn mark_descendant_needs_semantics(&self)
fn mark_descendant_needs_semantics(&self)
One flag serves both: the tree merges a subcompose node on every update, and a descendant’s change leaves its reach as it was.
fn mount(&mut self)
fn unmount(&mut self)
Source§fn insert_child(&mut self, child: NodeId) -> bool
fn insert_child(&mut self, child: NodeId) -> bool
child to this node’s child list, returning whether the list
actually changed. A node that already holds the child returns false:
callers record a structural change from this answer, and a structural
change re-lowers the whole subtree, so claiming one for a no-op costs a
full rebuild per call.Source§fn remove_child(&mut self, child: NodeId) -> bool
fn remove_child(&mut self, child: NodeId) -> bool
child from this node’s child list, returning whether the list
actually changed. Only this node can answer that: a caller inspecting
the child’s parent pointer gets it wrong when the child was reparented
while still listed here.fn move_child(&mut self, from: usize, to: usize)
fn update_children(&mut self, children: &[NodeId])
Source§fn collect_children_into(&self, out: &mut SmallVec<[NodeId; 8]>)
fn collect_children_into(&self, out: &mut SmallVec<[NodeId; 8]>)
fn collect_owned_children_into(&self, out: &mut SmallVec<[NodeId; 8]>)
Source§fn owned_child_index(&self, child: NodeId) -> Option<usize>
fn owned_child_index(&self, child: NodeId) -> Option<usize>
Node::collect_owned_children_into.
Nodes with slice-backed child storage should override this to avoid
materializing the whole list for a single lookup. Read moreSource§fn set_node_id(&mut self, id: NodeId)
fn set_node_id(&mut self, id: NodeId)
Source§fn on_attached_to_parent(&mut self, parent: NodeId)
fn on_attached_to_parent(&mut self, parent: NodeId)
Source§fn on_removed_from_parent(&mut self)
fn on_removed_from_parent(&mut self)
Source§fn parent(&self) -> Option<NodeId>
fn parent(&self) -> Option<NodeId>
Source§fn mark_needs_layout(&self)
fn mark_needs_layout(&self)
Source§fn needs_layout(&self) -> bool
fn needs_layout(&self) -> bool
Source§fn mark_needs_measure(&self)
fn mark_needs_measure(&self)
Source§fn needs_measure(&self) -> bool
fn needs_measure(&self) -> bool
Source§fn mark_descendant_needs_layout(&self, measure: bool)
fn mark_descendant_needs_layout(&self, measure: bool)
measure is set: a layout pass has to visit this node to reach it,
while this node’s own measurement may still hold. A node that does not
track the difference marks itself dirty.Source§fn descendant_needs_layout(&self) -> bool
fn descendant_needs_layout(&self) -> bool
Source§fn descendant_needs_measure(&self) -> bool
fn descendant_needs_measure(&self) -> bool
Source§fn mark_needs_semantics(&self)
fn mark_needs_semantics(&self)
Source§fn needs_semantics(&self) -> bool
fn needs_semantics(&self) -> bool
Source§fn set_parent_for_bubbling(&mut self, parent: NodeId)
fn set_parent_for_bubbling(&mut self, parent: NodeId)
fn update(&mut self)
Source§fn layout_dirty(&self) -> bool
fn layout_dirty(&self) -> bool
Source§fn is_virtual(&self) -> bool
fn is_virtual(&self) -> bool
Source§fn recycle_key(&self) -> Option<TypeId>
fn recycle_key(&self) -> Option<TypeId>
Source§fn recycle_pool_limit(&self) -> Option<usize>
fn recycle_pool_limit(&self) -> Option<usize>
Source§fn prepare_for_recycle(&mut self)
fn prepare_for_recycle(&mut self)
Source§fn rehouse_for_recycle(&self) -> Option<Box<dyn Node>>
fn rehouse_for_recycle(&self) -> Option<Box<dyn Node>>
Source§fn rehouse_for_live_compaction(&mut self) -> Option<Box<dyn Node>>
fn rehouse_for_live_compaction(&mut self) -> Option<Box<dyn Node>>
Source§fn debug_heap_bytes(&self) -> usize
fn debug_heap_bytes(&self) -> usize
Auto Trait Implementations§
impl !Freeze for SubcomposeLayoutNode
impl !RefUnwindSafe for SubcomposeLayoutNode
impl !Send for SubcomposeLayoutNode
impl !Sync for SubcomposeLayoutNode
impl !UnwindSafe for SubcomposeLayoutNode
impl Unpin for SubcomposeLayoutNode
impl UnsafeUnpin for SubcomposeLayoutNode
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more