Skip to content

struct

App

pub struct App {
    /* private fields */
}

A mounted application.

Methods

mount

pub fn mount(root: Component, registry: Registry, host: impl Host + 'static) -> Result<App, RenderError>

Mount root, render it into host, and keep it in sync with state.

tree

pub fn tree(&self) -> Vec<VNode>

A copy of the current virtual tree.

dispatch

pub fn dispatch(&self, path: &[usize], event: &Event) -> bool

Invoke the handlers for event.kind on the node at path. As in a browser, a click on a form's submit button (a button whose type is submit or unset, and isn't disabled) then submits the form.

accessibility_tree

pub fn accessibility_tree(&self) -> AccessNode

The accessibility tree of what's rendered now: roles, names and states, as assistive technology sees them.

activate

pub fn activate(&self, role: Role, name: &str) -> bool

Click the node with the given role and accessible name — how assistive technology (and tests) activate controls.

stylesheet

pub fn stylesheet(&self, theme: &Theme) -> String

Tailwind CSS (with preflight) for everything currently rendered.

stylesheet_with

pub fn stylesheet_with(&self, extra: &str, theme: &Theme) -> String

[App::stylesheet] that also styles extra classes used outside the app (on <body>).

to_html

pub fn to_html(&self) -> String

What's rendered now, as HTML (for prerendering and tests).

render_count

pub fn render_count(&self) -> usize

Number of successful renders so far.

unmount

pub fn unmount(&self)

Stop reacting to state changes and dispose component effects.