Skip to main content

SubcomposeLayoutNode

Struct SubcomposeLayoutNode 

Source
pub struct SubcomposeLayoutNode { /* private fields */ }
Expand description

Node responsible for orchestrating measure-time subcomposition.

Implementations§

Source§

impl SubcomposeLayoutNode

Source

pub fn new( modifier: Modifier, measure_policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>, ) -> Self

Source

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.

Source

pub fn handle(&self) -> SubcomposeLayoutNodeHandle

Source

pub fn set_measure_policy( &mut self, policy: Rc<dyn for<'scope> Fn(&mut SubcomposeMeasureScopeImpl<'scope>, Constraints) -> MeasureResult>, )

Source

pub fn set_modifier(&mut self, modifier: Modifier)

Source

pub fn set_debug_modifiers(&mut self, enabled: bool)

Source

pub fn modifier(&self) -> Modifier

Source

pub fn resolved_modifiers(&self) -> ResolvedModifiers

Source

pub fn layout_state(&self) -> LayoutState

Returns a clone of the current layout state.

Source

pub fn set_position(&self, position: Point)

Updates the position of this node. Called during placement.

Source

pub fn set_measured_size(&self, size: Size)

Updates the measured size of this node. Called during measurement.

Source

pub fn clear_placed(&self)

Clears the is_placed flag. Called at the start of a layout pass.

Source

pub fn modifier_slices_snapshot(&self) -> Rc<ModifierNodeSlices>

Returns the modifier slices snapshot for rendering.

Source

pub fn state(&self) -> Ref<'_, SubcomposeState>

Source

pub fn state_mut(&self) -> RefMut<'_, SubcomposeState>

Source

pub fn active_children(&self) -> Vec<NodeId>

Source

pub fn mark_needs_measure(&self)

Mark this node as needing measure. Also marks it as needing layout.

Source

pub fn mark_needs_layout_flag(&self)

Mark this node as needing layout (but not necessarily measure).

Source

pub fn mark_needs_redraw(&self)

Mark this node as needing redraw without forcing measure/layout.

Source

pub fn needs_measure(&self) -> bool

Check if this node needs measure.

Source

pub fn mark_needs_semantics(&self)

Mark this node as needing semantics recomputation.

Source

pub fn needs_semantics_flag(&self) -> bool

Returns true when semantics need to be recomputed.

Source

pub fn needs_redraw(&self) -> bool

Returns true when this node requested a redraw since the last render pass.

Source

pub fn clear_needs_redraw(&self)

Source

pub fn mark_needs_pointer_pass(&self)

Marks this node as needing a fresh pointer-input pass.

Source

pub fn needs_pointer_pass(&self) -> bool

Returns true when pointer-input state needs to be recomputed.

Source

pub fn clear_needs_pointer_pass(&self)

Clears the pointer-input dirty flag after hosts service it.

Source

pub fn mark_needs_focus_sync(&self)

Marks this node as needing a focus synchronization.

Source

pub fn needs_focus_sync(&self) -> bool

Returns true when focus state needs to be synchronized.

Source

pub fn clear_needs_focus_sync(&self)

Clears the focus dirty flag after the focus manager processes it.

Source

pub fn modifier_capabilities(&self) -> NodeCapabilities

Returns the modifier capabilities for this node.

Source

pub fn has_layout_modifier_nodes(&self) -> bool

Source

pub fn has_draw_modifier_nodes(&self) -> bool

Source

pub fn has_pointer_input_modifier_nodes(&self) -> bool

Source

pub fn has_semantics_modifier_nodes(&self) -> bool

Source

pub fn has_focus_modifier_nodes(&self) -> bool

Trait Implementations§

Source§

impl Node for SubcomposeLayoutNode

Source§

fn set_parent_for_bubbling(&mut self, parent: NodeId)

Minimal parent setter for dirty flag bubbling.

Source§

fn mount(&mut self)

Source§

fn unmount(&mut self)

Source§

fn insert_child(&mut self, child: NodeId)

Source§

fn remove_child(&mut self, child: NodeId)

Source§

fn move_child(&mut self, from: usize, to: usize)

Source§

fn update_children(&mut self, children: &[NodeId])

Source§

fn children(&self) -> Vec<NodeId>

Source§

fn set_node_id(&mut self, id: NodeId)

Called after the node is created to record its own ID. Useful for nodes that need to store their ID for later operations.
Source§

fn on_attached_to_parent(&mut self, parent: NodeId)

Called when this node is attached to a parent. Nodes with parent tracking should set their parent reference here.
Source§

fn on_removed_from_parent(&mut self)

Called when this node is removed from its parent. Nodes with parent tracking should clear their parent reference here.
Source§

fn parent(&self) -> Option<NodeId>

Get this node’s parent ID (for nodes that track parents). Returns None if node has no parent or doesn’t track parents.
Source§

fn mark_needs_layout(&self)

Mark this node as needing layout (for nodes with dirty flags). Called during bubbling to propagate dirtiness up the tree.
Source§

fn needs_layout(&self) -> bool

Check if this node needs layout (for nodes with dirty flags).
Source§

fn mark_needs_measure(&self)

Mark this node as needing measure (size may have changed). Called during bubbling when children are added/removed.
Source§

fn needs_measure(&self) -> bool

Check if this node needs measure (for nodes with dirty flags).
Source§

fn mark_needs_semantics(&self)

Mark this node as needing semantics recomputation.
Source§

fn needs_semantics(&self) -> bool

Check if this node needs semantics recomputation.
Source§

fn update(&mut self)

Auto Trait Implementations§

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<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.