Skip to main content

SceneNode

Struct SceneNode 

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

Retained scene node stored contiguously inside SceneTree.

Implementations§

Source§

impl SceneNode

Safe optional accessors for SceneNode.

Source

pub fn new(generation: u32, kind: NodeKind, style: Style) -> Self

Creates an initialized live SceneNode with generation and kind.

§Arguments
  • u32 - Slot generation tag.
  • NodeKind - Semantic node kind.
  • Style - Initial compiled style.
§Returns
  • Self - Constructed scene node marked dirty for initial layout and paint.
Source

pub fn style_ref(&self) -> &Style

Returns a shared reference to the compiled Style without copying by value.

§Arguments
  • &Self - Scene node reference.
§Returns
  • &Style - Borrowed compiled style reference.
Source

pub fn parent_id(&self) -> Option<NodeId>

Returns the optional parent NodeId.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<NodeId> - Parent node handle if attached.
Source

pub fn get_handlers(&self) -> &EventHandlers

Returns a shared reference to the node’s EventHandlers without allocating NodeExtras.

§Arguments
  • &Self - Scene node reference.
§Returns
  • &EventHandlers - Borrowed event handler table (shared empty table when unallocated).
Source

pub fn get_mut_handlers(&mut self) -> &mut EventHandlers

Returns a mutable reference to the node’s EventHandlers, allocating NodeExtras lazily.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut EventHandlers - Mutable event handler table.
Source

pub fn set_handlers(&mut self, value: EventHandlers) -> &mut Self

Replaces the node’s EventHandlers, avoiding allocation when setting an empty table on a plain node.

§Arguments
  • &Self - Mutable scene node.
  • EventHandlers - Replacement event handler collection.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn hover_paint(&self) -> Option<PaintStyle>

Returns the optional hover paint style override.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<PaintStyle> - Hover paint style if registered.
Source

pub fn set_hover_style(&mut self, value: Option<PaintStyle>) -> &mut Self

Sets the optional hover paint style override.

§Arguments
  • &Self - Mutable scene node.
  • Option<PaintStyle> - Hover paint override or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_hover_style(&mut self) -> &mut Option<PaintStyle>

Returns a mutable reference to the optional hover paint style slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<PaintStyle> - Mutable hover paint override slot.
Source

pub fn set_key(&mut self, value: Option<String>) -> &mut Self

Sets the optional reconciliation key for keyed list items.

§Arguments
  • &Self - Mutable scene node.
  • Option<String> - Reconciliation key or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_key(&mut self) -> &mut Option<String>

Returns a mutable reference to the optional reconciliation key slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<String> - Mutable reconciliation key slot.
Source

pub fn owned_scope(&self) -> Option<Scope>

Returns the optional reactive scope owned by this node.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<Scope> - Attached reactive scope if present.
Source

pub fn set_scope(&mut self, value: Option<Scope>) -> &mut Self

Sets the optional reactive ownership scope on this node.

§Arguments
  • &Self - Mutable scene node.
  • Option<Scope> - Scope handle or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_scope(&mut self) -> &mut Option<Scope>

Returns a mutable reference to the optional reactive ownership scope slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<Scope> - Mutable scope slot.
Source

pub fn canvas_callback(&self) -> Option<CanvasDrawCallback>

Returns a cloned handle to the custom canvas painter if present.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<CanvasDrawCallback> - Custom canvas callback if set.
Source

pub fn set_canvas_painter( &mut self, value: Option<CanvasDrawCallback>, ) -> &mut Self

Sets the optional custom 2D canvas draw callback on this node.

§Arguments
  • &Self - Mutable scene node.
  • Option<CanvasDrawCallback> - Custom canvas painter or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_canvas_painter(&mut self) -> &mut Option<CanvasDrawCallback>

Returns a mutable reference to the optional custom canvas painter slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<CanvasDrawCallback> - Mutable canvas painter slot.
Source

pub fn a11y_props_ref(&self) -> Option<&A11yProps>

Borrows the optional explicit semantic accessibility metadata attached to this node without cloning.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<&A11yProps> - Borrowed accessibility metadata if explicitly configured (None in O(1) when extras is absent).
Source

pub fn a11y_props(&self) -> Option<A11yProps>

Returns the optional explicit semantic accessibility metadata attached to this node.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<A11yProps> - Cloned accessibility metadata if explicitly configured.
Source

pub fn set_a11y(&mut self, value: Option<A11yProps>) -> &mut Self

Sets the optional semantic accessibility metadata on this node.

§Arguments
  • &Self - Mutable scene node.
  • Option<A11yProps> - Accessibility metadata or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_a11y(&mut self) -> &mut Option<A11yProps>

Returns a mutable reference to the optional accessibility metadata slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<A11yProps> - Mutable accessibility metadata slot.
Source

pub fn virtual_scroll_metrics(&self) -> Option<(f32, f32)>

Returns the optional virtualized scroll metrics (scroll_y, total_content_height).

§Arguments
  • &Self - Scene node reference.
§Returns
  • Option<(f32, f32)> - Virtual scroll position and full content height when configured.
Source

pub fn set_virtual_scroll(&mut self, value: Option<(f32, f32)>) -> &mut Self

Sets the optional virtualized scroll metrics (scroll_y, total_content_height).

§Arguments
  • &Self - Mutable scene node.
  • Option<(f32, f32)> - Virtual scroll metrics or None to clear.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn get_mut_virtual_scroll(&mut self) -> &mut Option<(f32, f32)>

Returns a mutable reference to the optional virtualized scroll metrics slot.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Option<(f32, f32)> - Mutable virtual scroll metrics slot.
Source

pub fn add_lifecycle(&mut self, hook: Rc<dyn Lifecycle>)

Registers a Lifecycle observer on this scene node.

§Arguments
  • &Self - Mutable scene node.
  • Rc<dyn Lifecycle> - Shared lifecycle hook observer.
Source

pub fn get_mut_lifecycles(&mut self) -> &mut Vec<Rc<dyn Lifecycle>>

Returns a mutable reference to the lifecycle observer vector.

§Arguments
  • &Self - Mutable scene node.
§Returns
  • &mut Vec<Rc<dyn Lifecycle>> - Mutable lifecycle observer list.
Source

pub fn set_lifecycles(&mut self, value: Vec<Rc<dyn Lifecycle>>) -> &mut Self

Replaces the lifecycle observer vector on this node.

§Arguments
  • &Self - Mutable scene node.
  • Vec<Rc<dyn Lifecycle>> - Replacement lifecycle observers.
§Returns
  • &mut Self - Mutable scene node for chaining.
Source

pub fn lifecycle_observers(&self) -> Vec<Rc<dyn Lifecycle>>

Returns cloned handles to all Lifecycle observers attached to this node.

§Arguments
  • &Self - Scene node reference.
§Returns
  • Vec<Rc<dyn Lifecycle>> - Attached lifecycle observers.
Source§

impl SceneNode

Source

pub fn get_generation(&self) -> u32

Source

pub fn get_alive(&self) -> bool

Source

pub fn get_kind(&self) -> &NodeKind

Source

pub fn get_mut_kind(&mut self) -> &mut NodeKind

Source

pub fn set_kind(&mut self, val: NodeKind) -> &mut Self

Source

pub fn get_style(&self) -> Style

Source

pub fn get_mut_style(&mut self) -> &mut Style

Source

pub fn set_style(&mut self, val: Style) -> &mut Self

Source

pub fn get_layout_box(&self) -> LayoutBox

Source

pub fn get_mut_layout_box(&mut self) -> &mut LayoutBox

Source

pub fn set_layout_box(&mut self, val: LayoutBox) -> &mut Self

Source

pub fn get_dirty(&self) -> DirtyFlags

Source

pub fn get_mut_dirty(&mut self) -> &mut DirtyFlags

Source

pub fn set_dirty(&mut self, val: DirtyFlags) -> &mut Self

Source

pub fn get_mut_parent(&mut self) -> &mut Option<NodeId>

Source

pub fn set_parent(&mut self, val: Option<NodeId>) -> &mut Self

Source

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

Source

pub fn get_mut_children(&mut self) -> &mut Vec<NodeId>

Source

pub fn set_children(&mut self, val: Vec<NodeId>) -> &mut Self

Source

pub fn get_interaction(&self) -> InteractionState

Source

pub fn get_mut_interaction(&mut self) -> &mut InteractionState

Source

pub fn set_interaction(&mut self, val: InteractionState) -> &mut Self

Trait Implementations§

Source§

impl Debug for SceneNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut ::std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • ::std::fmt::Result - Success or failure of the formatting operation.

Auto Trait Implementations§

§

impl !RefUnwindSafe for SceneNode

§

impl !Send for SceneNode

§

impl !Sync for SceneNode

§

impl !UnwindSafe for SceneNode

§

impl Forget for SceneNode

§

impl Freeze for SceneNode
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<NodeId>: Freeze, *const NodeExtras is !null: Freeze, PhantomData<NodeExtras>: Freeze,

§

impl Move for SceneNode

§

impl Unpin for SceneNode
where *const u8 is !null: Unpin, Box<NodeExtras>: Unpin,

§

impl UnsafeUnpin for SceneNode

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.