Struct dioxus_web::WebsysRenderer[][src]

pub struct WebsysRenderer { /* fields omitted */ }

The WebsysRenderer provides a way of rendering a Dioxus Virtual DOM to the browser’s DOM. Under the hood, we leverage WebSys and interact directly with the DOM

Implementations

impl WebsysRenderer[src]

pub async fn start(root: FC<()>)[src]

This method is the primary entrypoint for Websys Dioxus apps. Will panic if an error occurs while rendering. See DioxusErrors for more information on how these errors could occour.

fn main() {
    wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example));
}

Run the app to completion, panicing if any error occurs while rendering. Pairs well with the wasm_bindgen async handler

pub fn new(root: FC<()>) -> Self[src]

Create a new instance of the Dioxus Virtual Dom with no properties for the root component.

This means that the root component must either consumes its own context, or statics are used to generate the page. The root component can access things like routing in its context.

pub fn new_with_props<T: 'static>(root: FC<T>, root_props: T) -> Self[src]

Create a new text-renderer instance from a functional component root. Automatically progresses the creation of the VNode tree to completion.

A VDom is automatically created. If you want more granular control of the VDom, use from_vdom

pub fn from_vdom(dom: VirtualDom) -> Self[src]

Create a new text renderer from an existing Virtual DOM.

pub async fn run(&mut self) -> Result<()>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.