api

Structs

NodeContext

Runtime context passed into user component lifecycle methods and event handlers.

Child-related fields intentionally separate semantic payload from engine transport:

  • projected_children is the raw transport family used by Slot
  • received_children is the normalized semantic payload that this node should treat as content from its caller
  • retained_received_children are former received children kept alive only so @out transitions can finish

A node's own private template or primitive-assembled structure is intentionally not surfaced here as a first-class "child family" for container consumers.

Properties

expanded_node

Type: Weak<ExpandedNode>

slot_index

Type: Property<Option<usize>>

slot index of this node in its container

local_stack_frame

Type: Rc<RuntimePropertiesStackFrame>

Stack frame of this component, used to look up stores

containing_component

Type: Weak<ExpandedNode>

Reference to the ExpandedNode of the component containing this node

elapsed_frames

Type: Property<u64>

The current global engine frame count.

elapsed_millis

Type: Property<u64>

The current global engine wall-clock time in milliseconds.

gyro

Type: Property<Gyro>

Current device orientation sensor reading.

accel

Type: Property<Accel>

Current device accelerometer reading.

bounds_parent

Type: Property<(f64, f64)>

The bounds of this element's immediate container (parent) in px

bounds_self

Type: Property<(f64, f64)>

The bounds of this element in px

measured_size

Type: Property<Option<(f64, f64)>>

Measured bounds resolved by the chassis or container layout for this node.

subtree_layout_hull

Type: Property<LayoutHull>

Node-local subtree layout hull published by the engine for container measurement.

platform

Type: Platform

Current platform (Web/Native) this app is running on

os

Type: OS

Current os (Android/Windows/Mac/Linux) this app is running on

target

Type: Property<TargetInfo>

Derived target facts for platform/OS checks.

viewport

Type: Property<Viewport>

Derived viewport facts for size and orientation checks.

projected_children_count

Type: Property<usize>

The number of projected children available to this node.

This is the raw transport count used by slot-driven implementations. Container-style consumers usually want received_children_count instead.

node_transform_and_bounds

Type: TransformAndBounds<NodeLocal, Window>

The transform of this node in the global coordinate space

projected_children

Type: Property<Vec<Rc<ExpandedNode>>>

Children projected into this node from the containing component.

Projection is an engine transport mechanism. Consumers that want the semantic payload owned by this node should prefer received_children.

projected_children_changed

Type: Property<()>

A structural invalidation signal for projected children.

received_children

Type: Property<Vec<Rc<ExpandedNode>>>

Semantic payload children received by this node from its caller.

This is the canonical "content" view for container-style logic. It excludes private encapsulated implementation children and also excludes exit-retained payload nodes, which instead appear in retained_received_children.

received_children_count

Type: Property<usize>

Convenience count derived from received_children.

received_children_changed

Type: Property<()>

A structural invalidation signal for received_children.

Prefer this or received_children itself for structural subscriptions that must react to reorders as well as insertions and removals.

retained_received_children

Type: Property<Vec<Rc<ExpandedNode>>>

Received children retained only so exit transitions can finish.

These are no longer part of the active semantic payload, but some containers still need to place them as ghosts or overlays while their @out transitions run.

retained_received_children_changed

Type: Property<()>

A structural invalidation signal for retained_received_children.

Implementations

clear_subscriptions
pub fn clear_subscriptions(&self)

Remove all subscriptions registered on this node.

dispatch_event
pub fn dispatch_event(&self, identifier: &'static str) -> Result<(), String>

Queue a named custom event from this component for dispatch at the end of the tick.

elapsed_time_millis
pub fn elapsed_time_millis(&self) -> u128

Milliseconds elapsed according to the chassis-provided clock.

get_node_interface
pub fn get_node_interface(&self) -> Option<NodeInterface>

Return the interface for this node's containing component, when present.

get_screenshot_map
pub fn get_screenshot_map(&self) -> Rc<RefCell<HashMap<u32, ScreenshotData>>>

Shared map where completed screenshot captures are published by id.

local_point
pub fn local_point(&self, p: Point2<Window>) -> Point2<NodeLocal>

Convert a window-space point into this node's local coordinate space, including any presentation offsets inherited from ancestor scrollers.

pub fn navigate_to(&self, url: &str, target: NavigationTarget)

Ask the chassis to navigate to a URL.

On web targets, same-origin navigation in the current tab can be handled through the browser History API and routed back into Pax without a full page reload. Other targets use the active chassis navigation behavior.

peek_local_store
pub fn peek_local_store<T: Store, V>(&self, f: impl FnOnce(&mut T) -> V) -> Result<V, String>

Borrow the nearest stack-local store of type T.

push_local_store
pub fn push_local_store<T: Store>(&self, store: T)

Push component-local state onto the runtime stack for descendants to find.

screenshot
pub fn screenshot(&self, id: u32)

Request a screenshot capture from the chassis, keyed by caller-provided id.

set_cursor
pub fn set_cursor(&self, cursor: CursorStyle)

Ask the chassis to display the requested cursor over the app surface.

subscribe
pub fn subscribe(&self, dependencies: &[UntypedProperty], f: impl Fn() + 'static)

Attach a dependency subscription whose callback runs when any dependency dirties.